Skip to content

Commit

Permalink
#33, #34, #56 Various bugfixes and changes in behavior
Browse files Browse the repository at this point in the history
- Removed precaching completely
- Workaround for MusicBee's insistance of calling GetFile() on folders
- Workaround for MusicBee's opening of last used Folder/File on startup
  • Loading branch information
midwan committed Feb 5, 2021
1 parent 52114b6 commit 80b116d
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 358 deletions.
2 changes: 0 additions & 2 deletions MB_SubSonic/Domain/SubsonicSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public enum ServerType
public ConnectionProtocol Protocol { get; set; }
public AuthMethod Auth { get; set; }
public string BitRate { get; set; }
public bool UseIndexCache { get; set; }
public bool PreCacheAll { get; set; }
}

public static class SubsonicSettingsExtensions
Expand Down
5 changes: 0 additions & 5 deletions MB_SubSonic/Helpers/FileHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public static SubsonicSettings ReadSettingsFromFile(string settingsFilename)
if (string.IsNullOrEmpty(settings.BitRate))
settings.BitRate = "Unlimited";

settings.UseIndexCache = AesEncryption.Decrypt(reader.ReadLine(), Passphrase) == "Y";

return settings;
}
}
Expand Down Expand Up @@ -76,9 +74,6 @@ public static bool SaveSettingsToFile(SubsonicSettings settings, string filename
settings.Auth == SubsonicSettings.AuthMethod.HexPass ? "HexPass" : "Token",
Passphrase));
writer.WriteLine(AesEncryption.Encrypt(settings.BitRate, Passphrase));
writer.WriteLine(settings.UseIndexCache
? AesEncryption.Encrypt("Y", Passphrase)
: AesEncryption.Encrypt("N", Passphrase));
return true;
}
}
Expand Down
8 changes: 2 additions & 6 deletions MB_SubSonic/Helpers/SettingsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ public static SubsonicSettings SetDefaultSettings()
Protocol = SubsonicSettings.ConnectionProtocol.Http,
Auth = SubsonicSettings.AuthMethod.Token,
BitRate = string.Empty,
Transcode = false,
UseIndexCache = true,
PreCacheAll = false
Transcode = false
};
}

Expand All @@ -34,9 +32,7 @@ public static bool IsSettingChanged(SubsonicSettings newSettings, SubsonicSettin
|| !newSettings.Protocol.Equals(oldSettings.Protocol)
|| !newSettings.Auth.Equals(oldSettings.Auth)
|| !newSettings.Transcode.Equals(oldSettings.Transcode)
|| !newSettings.BitRate.Equals(oldSettings.BitRate)
|| !newSettings.UseIndexCache.Equals(oldSettings.UseIndexCache)
|| !newSettings.PreCacheAll.Equals(oldSettings.PreCacheAll);
|| !newSettings.BitRate.Equals(oldSettings.BitRate);
return result;
}

Expand Down
4 changes: 1 addition & 3 deletions MB_SubSonic/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public Interfaces.Plugin.PluginInfo Initialise(IntPtr apiInterfacePtr)
_mbApiInterface = new Interfaces.Plugin.MusicBeeApiInterface();
_mbApiInterface.Initialise(apiInterfacePtr);
Subsonic.SendNotificationsHandler = _mbApiInterface.MB_SendNotification;
Subsonic.CreateBackgroundTask = _mbApiInterface.MB_CreateBackgroundTask;
Subsonic.SetBackgroundTaskMessage = _mbApiInterface.MB_SetBackgroundTaskMessage;
Subsonic.RefreshPanels = _mbApiInterface.MB_RefreshPanels;
Subsonic.GetFileTag = _mbApiInterface.Library_GetFileTag;
Expand All @@ -37,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 = 29;
_about.VersionMinor = 30;
_about.Revision = 0;
_about.MinInterfaceVersion = Interfaces.Plugin.MinInterfaceVersion;
_about.MinApiRevision = Interfaces.Plugin.MinApiRevision;
Expand Down Expand Up @@ -94,7 +93,6 @@ public void ReceiveNotification(string sourceFileUrl, Interfaces.Plugin.Notifica
{
case Interfaces.Plugin.NotificationType.PluginStartup:
var dataPath = _mbApiInterface.Setting_GetPersistentStoragePath();
Subsonic.CacheFilename = Path.Combine(dataPath, "subsonicCache.dat");
Subsonic.SettingsFilename = Path.Combine(dataPath, "subsonicSettings.dat");

Subsonic.SendNotificationsHandler.Invoke(Subsonic.Initialize()
Expand Down
6 changes: 3 additions & 3 deletions MB_SubSonic/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Blitter Studio")]
[assembly: AssemblyProduct("MB_SubSonic")]
[assembly: AssemblyCopyright("Copyright © Dimitris Panokostas 2016-2019")]
[assembly: AssemblyCopyright("Copyright © Dimitris Panokostas 2016-2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -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.29.0.0")]
[assembly: AssemblyFileVersion("2.29.0.0")]
[assembly: AssemblyVersion("2.30.0.0")]
[assembly: AssemblyFileVersion("2.30.0.0")]
Loading

0 comments on commit 80b116d

Please sign in to comment.