diff --git a/VXMusic/Connections/Lastfm/Scrobbling/LastfmScrobbler.cs b/VXMusic/Connections/Lastfm/Scrobbling/LastfmScrobbler.cs index 6b397af..f5e16df 100644 --- a/VXMusic/Connections/Lastfm/Scrobbling/LastfmScrobbler.cs +++ b/VXMusic/Connections/Lastfm/Scrobbling/LastfmScrobbler.cs @@ -11,13 +11,20 @@ public class LastfmScrobbler private readonly IServiceProvider _serviceProvider; private readonly ILogger _logger; - private static readonly string _databasePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "vxscrobbles.db"); + public static bool DbFileFileExists => File.Exists(_databasePath); + + private static readonly string _databasePath = + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "VirtualXtensions", + "VXMusic", "Cache", "vxscrobbles.db"); public LastfmScrobbler(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; _logger = _serviceProvider.GetService(typeof(ILogger)) as ILogger ?? throw new ApplicationException("A logger must be created in service provider."); + + if (!DbFileFileExists) + File.Create(_databasePath); } public async Task Scrobble(string artist, string album, string trackName) diff --git a/VXMusicDesktop/VXMusicDesktop.csproj b/VXMusicDesktop/VXMusicDesktop.csproj index 9335206..65ad22f 100644 --- a/VXMusicDesktop/VXMusicDesktop.csproj +++ b/VXMusicDesktop/VXMusicDesktop.csproj @@ -9,7 +9,7 @@ VXLogo.png Images\VXLogoIcon.ico Always - 0.6.4.18 + 0.6.4.19 en VXMusicDesktop VirtualXtensions