diff options
Diffstat (limited to 'Emby.Naming')
| -rw-r--r-- | Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs | 2 | ||||
| -rw-r--r-- | Emby.Naming/Common/NamingOptions.cs | 35 | ||||
| -rw-r--r-- | Emby.Naming/ExternalFiles/ExternalPathParser.cs | 12 | ||||
| -rw-r--r-- | Emby.Naming/ExternalFiles/ExternalPathParserResult.cs | 10 |
4 files changed, 57 insertions, 2 deletions
diff --git a/Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs b/Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs index 48ab8b57dc..ae8c8a39bc 100644 --- a/Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs +++ b/Emby.Naming/AudioBook/AudioBookFilePathParserResult.cs @@ -3,7 +3,7 @@ namespace Emby.Naming.AudioBook /// <summary> /// Data object for passing result of audiobook part/chapter extraction. /// </summary> - public struct AudioBookFilePathParserResult + public record struct AudioBookFilePathParserResult { /// <summary> /// Gets or sets optional number of path extracted from audiobook filename. diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs index e016d7e51f..a72e0ffc7a 100644 --- a/Emby.Naming/Common/NamingOptions.cs +++ b/Emby.Naming/Common/NamingOptions.cs @@ -181,6 +181,24 @@ namespace Emby.Naming.Common "volume" }; + ArtistSubfolders = new[] + { + "albums", + "broadcasts", + "bootlegs", + "compilations", + "dj-mixes", + "eps", + "live", + "mixtapes", + "others", + "remixes", + "singles", + "soundtracks", + "spokenwords", + "streets" + }; + AudioFileExtensions = new[] { ".669", @@ -280,6 +298,13 @@ namespace Emby.Naming.Common "default" }; + MediaHearingImpairedFlags = new[] + { + "cc", + "hi", + "sdh" + }; + EpisodeExpressions = new[] { // *** Begin Kodi Standard Naming @@ -728,11 +753,21 @@ namespace Emby.Naming.Common public string[] MediaDefaultFlags { get; set; } /// <summary> + /// Gets or sets list of external media hearing impaired flags. + /// </summary> + public string[] MediaHearingImpairedFlags { get; set; } + + /// <summary> /// Gets or sets list of album stacking prefixes. /// </summary> public string[] AlbumStackingPrefixes { get; set; } /// <summary> + /// Gets or sets list of artist subfolders. + /// </summary> + public string[] ArtistSubfolders { get; set; } + + /// <summary> /// Gets or sets list of subtitle file extensions. /// </summary> public string[] SubtitleFileExtensions { get; set; } diff --git a/Emby.Naming/ExternalFiles/ExternalPathParser.cs b/Emby.Naming/ExternalFiles/ExternalPathParser.cs index 3bde3a1cf9..1fa4fa5371 100644 --- a/Emby.Naming/ExternalFiles/ExternalPathParser.cs +++ b/Emby.Naming/ExternalFiles/ExternalPathParser.cs @@ -99,6 +99,18 @@ namespace Emby.Naming.ExternalFiles pathInfo.Language = culture.ThreeLetterISOLanguageName; extraString = extraString.Replace(currentSlice, string.Empty, StringComparison.OrdinalIgnoreCase); } + else if (culture != null && pathInfo.Language == "hin") + { + // Hindi language code "hi" collides with a hearing impaired flag - use as Hindi only if no other language is set + pathInfo.IsHearingImpaired = true; + pathInfo.Language = culture.ThreeLetterISOLanguageName; + extraString = extraString.Replace(currentSlice, string.Empty, StringComparison.OrdinalIgnoreCase); + } + else if (_namingOptions.MediaHearingImpairedFlags.Any(s => currentSliceWithoutSeparator.Contains(s, StringComparison.OrdinalIgnoreCase))) + { + pathInfo.IsHearingImpaired = true; + extraString = extraString.Replace(currentSlice, string.Empty, StringComparison.OrdinalIgnoreCase); + } else { titleString = currentSlice + titleString; diff --git a/Emby.Naming/ExternalFiles/ExternalPathParserResult.cs b/Emby.Naming/ExternalFiles/ExternalPathParserResult.cs index 1cc773a2e1..b0d9e7a9fd 100644 --- a/Emby.Naming/ExternalFiles/ExternalPathParserResult.cs +++ b/Emby.Naming/ExternalFiles/ExternalPathParserResult.cs @@ -11,11 +11,13 @@ namespace Emby.Naming.ExternalFiles /// <param name="path">Path to file.</param> /// <param name="isDefault">Is default.</param> /// <param name="isForced">Is forced.</param> - public ExternalPathParserResult(string path, bool isDefault = false, bool isForced = false) + /// <param name="isHearingImpaired">For the hearing impaired.</param> + public ExternalPathParserResult(string path, bool isDefault = false, bool isForced = false, bool isHearingImpaired = false) { Path = path; IsDefault = isDefault; IsForced = isForced; + IsHearingImpaired = isHearingImpaired; } /// <summary> @@ -47,5 +49,11 @@ namespace Emby.Naming.ExternalFiles /// </summary> /// <value><c>true</c> if this instance is forced; otherwise, <c>false</c>.</value> public bool IsForced { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether this instance is for the hearing impaired. + /// </summary> + /// <value><c>true</c> if this instance is for the hearing impaired; otherwise, <c>false</c>.</value> + public bool IsHearingImpaired { get; set; } } } |
