From 844736901cf064666414368dc99017a9b7df7bce Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Sat, 8 Jun 2019 13:17:24 +0200 Subject: [PATCH] Fixed Refresh would not reload the current folder files, missing changes in Rating/Star/Love settings. #49 --- MB_SubSonic/Plugin.cs | 13 ++++++++----- MB_SubSonic/Properties/AssemblyInfo.cs | 4 ++-- MB_SubSonic/Subsonic.cs | 4 +--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/MB_SubSonic/Plugin.cs b/MB_SubSonic/Plugin.cs index d27c4b7..b962c95 100644 --- a/MB_SubSonic/Plugin.cs +++ b/MB_SubSonic/Plugin.cs @@ -36,7 +36,7 @@ public Interfaces.Plugin.PluginInfo Initialise(IntPtr apiInterfacePtr) // current only applies to artwork, lyrics or instant messenger name that appears in the provider drop down selector or target Instant Messenger _about.Type = Interfaces.Plugin.PluginType.Storage; _about.VersionMajor = 2; // your plugin version - _about.VersionMinor = 27; + _about.VersionMinor = 28; _about.Revision = 0; _about.MinInterfaceVersion = Interfaces.Plugin.MinInterfaceVersion; _about.MinApiRevision = Interfaces.Plugin.MinApiRevision; @@ -152,8 +152,7 @@ public void ReceiveNotification(string sourceFileUrl, Interfaces.Plugin.Notifica break; case Interfaces.Plugin.NotificationType.PlaylistMoved: - string[] filenames; - Subsonic.QueryPlaylistFilesEx(sourceFileUrl, out filenames); + Subsonic.QueryPlaylistFilesEx(sourceFileUrl, out var filenames); // Get Song IDs to add to playlist var songIds = new List(); @@ -211,11 +210,15 @@ public string RetrieveArtwork(string sourceFileUrl, string albumArtist, string a public void Refresh() { if (Subsonic.IsInitialized) + { Subsonic.Refresh(); + } else + { Subsonic.SendNotificationsHandler.Invoke(Subsonic.Initialize() - ? Interfaces.Plugin.CallbackType.StorageReady - : Interfaces.Plugin.CallbackType.StorageFailed); + ? Interfaces.Plugin.CallbackType.StorageReady + : Interfaces.Plugin.CallbackType.StorageFailed); + } } public bool IsReady() diff --git a/MB_SubSonic/Properties/AssemblyInfo.cs b/MB_SubSonic/Properties/AssemblyInfo.cs index f2bb78b..6298c98 100644 --- a/MB_SubSonic/Properties/AssemblyInfo.cs +++ b/MB_SubSonic/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.27.0.0")] -[assembly: AssemblyFileVersion("2.27.0.0")] +[assembly: AssemblyVersion("2.28.0.0")] +[assembly: AssemblyFileVersion("2.28.0.0")] diff --git a/MB_SubSonic/Subsonic.cs b/MB_SubSonic/Subsonic.cs index f3c7d54..f0e0b25 100644 --- a/MB_SubSonic/Subsonic.cs +++ b/MB_SubSonic/Subsonic.cs @@ -302,9 +302,7 @@ public static string[] GetFolders(string path) if (!string.IsNullOrEmpty(path)) { - if (!cacheLoaded || _cacheUpdating || files == null) - return GetFolderFiles(path); - files = GetPathFilteredFiles(files, path); + return GetFolderFiles(path); } }