diff --git a/Jellyfin.Plugin.Streamyfin/Configuration/Config.cs b/Jellyfin.Plugin.Streamyfin/Configuration/Config.cs index 7378170..83a8c2b 100644 --- a/Jellyfin.Plugin.Streamyfin/Configuration/Config.cs +++ b/Jellyfin.Plugin.Streamyfin/Configuration/Config.cs @@ -92,6 +92,8 @@ public class ItemArgs [YamlMember(DefaultValuesHandling = DefaultValuesHandling.OmitEmptyCollections)] public List? genres { get; set; } public string? parentId { get; set; } + public string[]? filters { get; set; } + public bool? recursive { get; set; } } [XmlRoot("dictionary")] diff --git a/Jellyfin.Plugin.Streamyfin/Configuration/PluginConfiguration.cs b/Jellyfin.Plugin.Streamyfin/Configuration/PluginConfiguration.cs index d305494..e9e1bae 100644 --- a/Jellyfin.Plugin.Streamyfin/Configuration/PluginConfiguration.cs +++ b/Jellyfin.Plugin.Streamyfin/Configuration/PluginConfiguration.cs @@ -5,6 +5,8 @@ using System.Collections.Generic; using MediaBrowser.Model.Plugins; using System.Diagnostics.CodeAnalysis; +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.NamingConventions; namespace Jellyfin.Plugin.Streamyfin.Configuration; @@ -19,6 +21,34 @@ public class PluginConfiguration : BasePluginConfiguration public PluginConfiguration() { + + var Yaml = @" +home: + sections: + Trending: + style: portrait + type: row + items: + args: + parentId: YOURCOLLECTIONID + Continue Watching: + style: landscape + type: row + items: + args: + recursive: true + filters: + - isResumable +"; + + var deserializer = new DeserializerBuilder() + .WithNamingConvention(CamelCaseNamingConvention.Instance) // see height_in_inches in sample yml + .Build(); + + + Config = deserializer.Deserialize(Yaml); + + /* Config = new Config{ marlinSearch = new Search{ enabled = false, @@ -27,23 +57,32 @@ public PluginConfiguration() home = new Home{ sections = new SerializableDictionary { + { "Trending collection", new Section{ + style = SectionStyle.portrait, + type = SectionType.carousel, + items = new SectionItemResolver + {args = new ItemArgs{ + parentId = "YOURCOLLECTIONID" + } } } , + { "Continue Watching", new Section{ + style = SectionStyle.portrait, + type = SectionType.carousel, + items = new SectionItemResolver + {args = new ItemArgs{ + filters = "YOURCOLLECTIONID" + } } }, { "Anime", new Section{ style = SectionStyle.portrait, type = SectionType.row, items = new SectionItemResolver{ args = new ItemArgs{ genres = new List{"Anime"} } - } } }, - { "Trending collection", new Section{ - style = SectionStyle.portrait, - type = SectionType.carousel, - items = new SectionItemResolver - {args = new ItemArgs{ - parentId = "YOURCOLLECTIONID" - } } } } + } } } } } } + }; + */ //Yaml /* SfConfig = "test"; diff --git a/Jellyfin.Plugin.Streamyfin/Jellyfin.Plugin.Streamyfin.csproj b/Jellyfin.Plugin.Streamyfin/Jellyfin.Plugin.Streamyfin.csproj index 7c00047..e9d629b 100644 --- a/Jellyfin.Plugin.Streamyfin/Jellyfin.Plugin.Streamyfin.csproj +++ b/Jellyfin.Plugin.Streamyfin/Jellyfin.Plugin.Streamyfin.csproj @@ -2,8 +2,8 @@ net8.0 Jellyfin.Plugin.Streamyfin - 0.13 - 0.13 + 0.14 + 0.14 true true enable diff --git a/Makefile b/Makefile index dbd99a4..5786a6c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -export VERSION := 0.13 +export VERSION := 0.14 export GITHUB_REPO := lostb1t/jellyfin-plugin-streamyfin export FILE := streamyfin-${VERSION}.zip