Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
lostb1t committed Aug 25, 2024
1 parent 22ca9f5 commit f530741
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Jellyfin.Plugin.Streamyfin/Configuration/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ public class ItemArgs
[YamlMember(DefaultValuesHandling = DefaultValuesHandling.OmitEmptyCollections)]
public List<string>? genres { get; set; }
public string? parentId { get; set; }
public string[]? filters { get; set; }
public bool? recursive { get; set; }
}

[XmlRoot("dictionary")]
Expand Down
55 changes: 47 additions & 8 deletions Jellyfin.Plugin.Streamyfin/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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<Config>(Yaml);

/*
Config = new Config{
marlinSearch = new Search{
enabled = false,
Expand All @@ -27,23 +57,32 @@ public PluginConfiguration()
home = new Home{
sections = new SerializableDictionary<string, Section>
{
{ "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<string>{"Anime"}
}
} } },
{ "Trending collection", new Section{
style = SectionStyle.portrait,
type = SectionType.carousel,
items = new SectionItemResolver
{args = new ItemArgs{
parentId = "YOURCOLLECTIONID"
} } } }
} } } }
}
}
};
*/
//Yaml
/*
SfConfig = "test";
Expand Down
4 changes: 2 additions & 2 deletions Jellyfin.Plugin.Streamyfin/Jellyfin.Plugin.Streamyfin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Jellyfin.Plugin.Streamyfin</RootNamespace>
<AssemblyVersion>0.13</AssemblyVersion>
<FileVersion>0.13</FileVersion>
<AssemblyVersion>0.14</AssemblyVersion>
<FileVersion>0.14</FileVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export VERSION := 0.13
export VERSION := 0.14
export GITHUB_REPO := lostb1t/jellyfin-plugin-streamyfin
export FILE := streamyfin-${VERSION}.zip

Expand Down

0 comments on commit f530741

Please sign in to comment.