Skip to content

Commit

Permalink
Fix extra type differentiation
Browse files Browse the repository at this point in the history
Change rules for Featurettes and Shorts so they don't both get classed as ExtraType.Clip.

Fix test that these changes break
  • Loading branch information
photonconvergence committed Oct 28, 2022
1 parent 790f67a commit 09e8a7e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
14 changes: 10 additions & 4 deletions Emby.Naming/Common/NamingOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,13 @@ public NamingOptions()
MediaType.Video),

new ExtraRule(
ExtraType.Clip,
ExtraType.Short,
ExtraRuleType.DirectoryName,
"shorts",
MediaType.Video),

new ExtraRule(
ExtraType.Clip,
ExtraType.Featurette,
ExtraRuleType.DirectoryName,
"featurettes",
MediaType.Video),
Expand All @@ -535,6 +535,12 @@ public NamingOptions()
"other",
MediaType.Video),

new ExtraRule(
ExtraType.Clip,
ExtraRuleType.DirectoryName,
"clips",
MediaType.Video),

new ExtraRule(
ExtraType.Trailer,
ExtraRuleType.Filename,
Expand Down Expand Up @@ -638,13 +644,13 @@ public NamingOptions()
MediaType.Video),

new ExtraRule(
ExtraType.Clip,
ExtraType.Featurette,
ExtraRuleType.Suffix,
"-featurette",
MediaType.Video),

new ExtraRule(
ExtraType.Clip,
ExtraType.Short,
ExtraRuleType.Suffix,
"-short",
MediaType.Video),
Expand Down
4 changes: 3 additions & 1 deletion MediaBrowser.Controller/Entities/BaseItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public static readonly string[] SupportedImageExtensions
Model.Entities.ExtraType.DeletedScene,
Model.Entities.ExtraType.Interview,
Model.Entities.ExtraType.Sample,
Model.Entities.ExtraType.Scene
Model.Entities.ExtraType.Scene,
Model.Entities.ExtraType.Featurette,
Model.Entities.ExtraType.Short
};

private string _sortName;
Expand Down
4 changes: 3 additions & 1 deletion MediaBrowser.Model/Entities/ExtraType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public enum ExtraType
Scene = 6,
Sample = 7,
ThemeSong = 8,
ThemeVideo = 9
ThemeVideo = 9,
Featurette = 10,
Short = 11
}
}
5 changes: 3 additions & 2 deletions tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ public void TestExpandedExtras()
[InlineData(ExtraType.Interview, "interviews")]
[InlineData(ExtraType.Scene, "scenes")]
[InlineData(ExtraType.Sample, "samples")]
[InlineData(ExtraType.Clip, "shorts")]
[InlineData(ExtraType.Clip, "featurettes")]
[InlineData(ExtraType.Short, "shorts")]
[InlineData(ExtraType.Featurette, "featurettes")]
[InlineData(ExtraType.Clip, "clips")]
[InlineData(ExtraType.ThemeVideo, "backdrops")]
[InlineData(ExtraType.Unknown, "extras")]
public void TestDirectories(ExtraType type, string dirName)
Expand Down

0 comments on commit 09e8a7e

Please sign in to comment.