Fix extra type differentiation

Change rules for Featurettes and Shorts so they don't both get classed as ExtraType.Clip.

Fix test that these changes break
This commit is contained in:
photonconvergence 2022-10-27 18:01:04 -07:00
parent 790f67aac1
commit 09e8a7e62c
4 changed files with 19 additions and 8 deletions

View File

@ -512,13 +512,13 @@ namespace Emby.Naming.Common
MediaType.Video),
new ExtraRule(
ExtraType.Clip,
ExtraType.Short,
ExtraRuleType.DirectoryName,
"shorts",
MediaType.Video),
new ExtraRule(
ExtraType.Clip,
ExtraType.Featurette,
ExtraRuleType.DirectoryName,
"featurettes",
MediaType.Video),
@ -535,6 +535,12 @@ namespace Emby.Naming.Common
"other",
MediaType.Video),
new ExtraRule(
ExtraType.Clip,
ExtraRuleType.DirectoryName,
"clips",
MediaType.Video),
new ExtraRule(
ExtraType.Trailer,
ExtraRuleType.Filename,
@ -638,13 +644,13 @@ namespace Emby.Naming.Common
MediaType.Video),
new ExtraRule(
ExtraType.Clip,
ExtraType.Featurette,
ExtraRuleType.Suffix,
"-featurette",
MediaType.Video),
new ExtraRule(
ExtraType.Clip,
ExtraType.Short,
ExtraRuleType.Suffix,
"-short",
MediaType.Video),

View File

@ -75,7 +75,9 @@ namespace MediaBrowser.Controller.Entities
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;

View File

@ -13,6 +13,8 @@ namespace MediaBrowser.Model.Entities
Scene = 6,
Sample = 7,
ThemeSong = 8,
ThemeVideo = 9
ThemeVideo = 9,
Featurette = 10,
Short = 11
}
}

View File

@ -51,8 +51,9 @@ namespace Jellyfin.Naming.Tests.Video
[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)