feat: allow to initialize empty playlist file.
This commit is contained in:
parent
4537a3aee3
commit
f41485cecf
1 changed files with 3 additions and 0 deletions
|
@ -15,6 +15,9 @@ namespace Jellyfin.Plugin.SmartPlaylist {
|
||||||
}
|
}
|
||||||
private async Task<SmartPlaylistDto> LoadPlaylistAsync(string filename) {
|
private async Task<SmartPlaylistDto> LoadPlaylistAsync(string filename) {
|
||||||
var r = File.ReadAllText(filename);
|
var r = File.ReadAllText(filename);
|
||||||
|
if (r.Equals("")) {
|
||||||
|
r = "{}";
|
||||||
|
}
|
||||||
var dto = new DeserializerBuilder().Build().Deserialize<SmartPlaylistDto>(r);
|
var dto = new DeserializerBuilder().Build().Deserialize<SmartPlaylistDto>(r);
|
||||||
if (dto == null)
|
if (dto == null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue