From f7d71a2bc722a178c967ac736c4c2b920eefa10f Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 4 Dec 2019 21:47:01 +0100 Subject: [PATCH 1/6] Remove unused fields and properties --- .../ServerApplicationPaths.cs | 17 +++++------------ .../IServerApplicationPaths.cs | 17 +++++------------ 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/Emby.Server.Implementations/ServerApplicationPaths.cs b/Emby.Server.Implementations/ServerApplicationPaths.cs index 4b8298abbd..2f57c97a13 100644 --- a/Emby.Server.Implementations/ServerApplicationPaths.cs +++ b/Emby.Server.Implementations/ServerApplicationPaths.cs @@ -1,4 +1,3 @@ -using System; using System.IO; using Emby.Server.Implementations.AppBase; using MediaBrowser.Controller; @@ -10,8 +9,6 @@ namespace Emby.Server.Implementations /// public class ServerApplicationPaths : BaseApplicationPaths, IServerApplicationPaths { - private string _defaultTranscodePath; - private string _transcodePath; private string _internalMetadataPath; /// @@ -23,7 +20,8 @@ namespace Emby.Server.Implementations string configurationDirectoryPath, string cacheDirectoryPath, string webDirectoryPath) - : base(programDataPath, + : base( + programDataPath, logDirectoryPath, configurationDirectoryPath, cacheDirectoryPath, @@ -31,8 +29,6 @@ namespace Emby.Server.Implementations { } - public string ApplicationResourcesPath { get; } = AppContext.BaseDirectory; - /// /// Gets the path to the base root media directory. /// @@ -45,18 +41,13 @@ namespace Emby.Server.Implementations /// The default user views path. public string DefaultUserViewsPath => Path.Combine(RootFolderPath, "default"); - /// - /// Gets the path to localization data. - /// - /// The localization path. - public string LocalizationPath => Path.Combine(ProgramDataPath, "localization"); - /// /// Gets the path to the People directory. /// /// The people path. public string PeoplePath => Path.Combine(InternalMetadataPath, "People"); + /// public string ArtistsPath => Path.Combine(InternalMetadataPath, "artists"); /// @@ -107,12 +98,14 @@ namespace Emby.Server.Implementations /// The user configuration directory path. public string UserConfigurationDirectoryPath => Path.Combine(ConfigurationDirectoryPath, "users"); + /// public string InternalMetadataPath { get => _internalMetadataPath ?? (_internalMetadataPath = Path.Combine(DataPath, "metadata")); set => _internalMetadataPath = value; } + /// public string VirtualInternalMetadataPath { get; } = "%MetadataPath%"; } } diff --git a/MediaBrowser.Controller/IServerApplicationPaths.cs b/MediaBrowser.Controller/IServerApplicationPaths.cs index 56e7e4e47a..5d7c60910a 100644 --- a/MediaBrowser.Controller/IServerApplicationPaths.cs +++ b/MediaBrowser.Controller/IServerApplicationPaths.cs @@ -10,24 +10,12 @@ namespace MediaBrowser.Controller /// The root folder path. string RootFolderPath { get; } - /// - /// Gets the application resources path. This is the path to the folder containing resources that are deployed as part of the application - /// - /// The application resources path. - string ApplicationResourcesPath { get; } - /// /// Gets the path to the default user view directory. Used if no specific user view is defined. /// /// The default user views path. string DefaultUserViewsPath { get; } - /// - /// Gets the path to localization data. - /// - /// The localization path. - string LocalizationPath { get; } - /// /// Gets the path to the People directory /// @@ -87,8 +75,13 @@ namespace MediaBrowser.Controller /// /// The internal metadata path. string InternalMetadataPath { get; } + string VirtualInternalMetadataPath { get; } + /// + /// Gets the path to the artists directory. + /// + /// The artists path. string ArtistsPath { get; } } } From 4a0df15bbd7f4cb87eba2e0a2ff39b74abd083fe Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 4 Dec 2019 22:18:37 +0100 Subject: [PATCH 2/6] Fix GetTranscodePath function and cache path update logline * GetTranscodePath returned an empty string after the option was left blank in the web UI * Unified the log style for all paths --- .../AppBase/BaseConfigurationManager.cs | 10 ++++++---- .../Configuration/EncodingConfigurationExtensions.cs | 11 +++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs index 67bb25b077..2a5d56c603 100644 --- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs +++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs @@ -84,6 +84,7 @@ namespace Emby.Server.Implementations.AppBase /// /// The logger. protected ILogger Logger { get; private set; } + /// /// Gets the XML serializer. /// @@ -97,7 +98,7 @@ namespace Emby.Server.Implementations.AppBase public IApplicationPaths CommonApplicationPaths { get; private set; } /// - /// Gets the system configuration. + /// Gets or sets the system configuration. /// /// The configuration. public BaseApplicationConfiguration CommonConfiguration @@ -123,6 +124,7 @@ namespace Emby.Server.Implementations.AppBase return _configuration; } } + protected set { _configuration = value; @@ -215,7 +217,7 @@ namespace Emby.Server.Implementations.AppBase cachePath = CommonConfiguration.CachePath; } - Logger.LogInformation("Setting cache path to " + cachePath); + Logger.LogInformation("Setting cache path: {Path}", cachePath); ((BaseApplicationPaths)CommonApplicationPaths).CachePath = cachePath; } @@ -223,7 +225,7 @@ namespace Emby.Server.Implementations.AppBase /// Replaces the cache path. /// /// The new configuration. - /// + /// The new cache path doesn't exist. private void ValidateCachePath(BaseApplicationConfiguration newConfig) { var newPath = newConfig.CachePath; @@ -234,7 +236,7 @@ namespace Emby.Server.Implementations.AppBase // Validate if (!Directory.Exists(newPath)) { - throw new FileNotFoundException( + throw new DirectoryNotFoundException( string.Format( CultureInfo.InvariantCulture, "{0} does not exist.", diff --git a/MediaBrowser.Common/Configuration/EncodingConfigurationExtensions.cs b/MediaBrowser.Common/Configuration/EncodingConfigurationExtensions.cs index 2bf1f6bc8c..ccf9658988 100644 --- a/MediaBrowser.Common/Configuration/EncodingConfigurationExtensions.cs +++ b/MediaBrowser.Common/Configuration/EncodingConfigurationExtensions.cs @@ -22,7 +22,14 @@ namespace MediaBrowser.Common.Configuration /// The Configuration manager. /// The transcoding temp path. public static string GetTranscodePath(this IConfigurationManager configurationManager) - => configurationManager.GetEncodingOptions().TranscodingTempPath - ?? Path.Combine(configurationManager.CommonApplicationPaths.ProgramDataPath, "transcodes"); + { + var transcodingTempPath = configurationManager.GetEncodingOptions().TranscodingTempPath; + if (string.IsNullOrEmpty(transcodingTempPath)) + { + return Path.Combine(configurationManager.CommonApplicationPaths.ProgramDataPath, "transcodes"); + } + + return transcodingTempPath; + } } } From 8718e1ea6b76386e4b5032da0a770cec1b7acf42 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Thu, 5 Dec 2019 18:30:56 +0100 Subject: [PATCH 3/6] Add installed plugins to bug reports --- .github/ISSUE_TEMPLATE/bug_report.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ca89c1cb91..bd13d4b00e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -30,6 +30,7 @@ assignees: '' - OS: [e.g. Docker, Debian, Windows] - Browser: [e.g. Firefox, Chrome, Safari] - Jellyfin Version: [e.g. 10.0.1] + - Installed Plugins: [e.g. none, Fanart, Anime, etc.] - Reverse proxy: [e.g. no, nginx, apache, etc.] **Additional context** From 8694577c7164cc65ad68cf0ee5fa0963f6b2ad39 Mon Sep 17 00:00:00 2001 From: gustinn Date: Thu, 5 Dec 2019 18:29:37 +0000 Subject: [PATCH 4/6] Added translation using Weblate (Icelandic) --- Emby.Server.Implementations/Localization/Core/is.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 Emby.Server.Implementations/Localization/Core/is.json diff --git a/Emby.Server.Implementations/Localization/Core/is.json b/Emby.Server.Implementations/Localization/Core/is.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/Emby.Server.Implementations/Localization/Core/is.json @@ -0,0 +1 @@ +{} From caa57d5bda10722b1224e774f30f4ccad4f8c446 Mon Sep 17 00:00:00 2001 From: memnos Date: Thu, 5 Dec 2019 10:57:35 +0000 Subject: [PATCH 5/6] Translated using Weblate (Italian) Translation: Jellyfin/Jellyfin Translate-URL: https://translate.jellyfin.org/projects/jellyfin/jellyfin-core/it/ --- .../Localization/Core/it.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Emby.Server.Implementations/Localization/Core/it.json b/Emby.Server.Implementations/Localization/Core/it.json index 357883cd37..8f91effb92 100644 --- a/Emby.Server.Implementations/Localization/Core/it.json +++ b/Emby.Server.Implementations/Localization/Core/it.json @@ -9,13 +9,13 @@ "Channels": "Canali", "ChapterNameValue": "Capitolo {0}", "Collections": "Collezioni", - "DeviceOfflineWithName": "{0} è stato disconnesso", + "DeviceOfflineWithName": "{0} ha disconnesso", "DeviceOnlineWithName": "{0} è connesso", "FailedLoginAttemptWithUserName": "Tentativo di accesso fallito da {0}", "Favorites": "Preferiti", "Folders": "Cartelle", "Genres": "Generi", - "HeaderAlbumArtists": "Artisti Album", + "HeaderAlbumArtists": "Artisti dell' Album", "HeaderCameraUploads": "Caricamenti Fotocamera", "HeaderContinueWatching": "Continua a guardare", "HeaderFavoriteAlbums": "Album preferiti", @@ -32,7 +32,7 @@ "ItemRemovedWithName": "{0} è stato rimosso dalla libreria", "LabelIpAddressValue": "Indirizzo IP: {0}", "LabelRunningTimeValue": "Durata: {0}", - "Latest": "Più recenti", + "Latest": "Novità", "MessageApplicationUpdated": "Il Server Jellyfin è stato aggiornato", "MessageApplicationUpdatedTo": "Jellyfin Server è stato aggiornato a {0}", "MessageNamedServerConfigurationUpdatedWithValue": "La sezione {0} della configurazione server è stata aggiornata", @@ -43,7 +43,7 @@ "MusicVideos": "Video musicali", "NameInstallFailed": "{0} installazione fallita", "NameSeasonNumber": "Stagione {0}", - "NameSeasonUnknown": "Stagione sconosciuto", + "NameSeasonUnknown": "Stagione sconosciuta", "NewVersionIsAvailable": "Una nuova versione di Jellyfin Server è disponibile per il download.", "NotificationOptionApplicationUpdateAvailable": "Aggiornamento dell'applicazione disponibile", "NotificationOptionApplicationUpdateInstalled": "Aggiornamento dell'applicazione installato", @@ -88,9 +88,9 @@ "UserOfflineFromDevice": "{0} è stato disconnesso da {1}", "UserOnlineFromDevice": "{0} è online da {1}", "UserPasswordChangedWithName": "La password è stata cambiata per l'utente {0}", - "UserPolicyUpdatedWithName": "La politica dell'utente è stata aggiornata per {0}", - "UserStartedPlayingItemWithValues": "{0} ha avviato la riproduzione di {1}", - "UserStoppedPlayingItemWithValues": "{0} ha interrotto la riproduzione di {1}", + "UserPolicyUpdatedWithName": "La policy dell'utente è stata aggiornata per {0}", + "UserStartedPlayingItemWithValues": "{0} ha avviato la riproduzione di {1} su {2}", + "UserStoppedPlayingItemWithValues": "{0} ha interrotto la riproduzione di {1} su {2}", "ValueHasBeenAddedToLibrary": "{0} è stato aggiunto alla tua libreria multimediale", "ValueSpecialEpisodeName": "Speciale - {0}", "VersionNumber": "Versione {0}" From 8befab5b5dc586a7673a1dc384cf41044c37351c Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Fri, 6 Dec 2019 20:21:18 +0100 Subject: [PATCH 6/6] Simplify regex to avoid catastrophic backtracking --- Emby.Naming/Common/NamingOptions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs index d37be0e639..4c2c43437a 100644 --- a/Emby.Naming/Common/NamingOptions.cs +++ b/Emby.Naming/Common/NamingOptions.cs @@ -314,7 +314,7 @@ namespace Emby.Naming.Common // This isn't a Kodi naming rule, but the expression below causes false positives, // so we make sure this one gets tested first. // "Foo Bar 889" - new EpisodeExpression(@".*[\\\/](?![Ee]pisode)(?(\w+\s*?)*)\s(?\d{1,3})(-(?\d{2,3}))*[^\\\/]*$") + new EpisodeExpression(@".*[\\\/](?![Ee]pisode)(?[\w\s]+?)\s(?\d{1,3})(-(?\d{2,3}))*[^\\\/]*$") { IsNamed = true }, @@ -337,7 +337,7 @@ namespace Emby.Naming.Common // *** End Kodi Standard Naming                 // [bar] Foo - 1 [baz] - new EpisodeExpression(@".*?(\[.*?\])+.*?(?(\w+\s*?)+?)[-\s_]+(?\d+).*$") + new EpisodeExpression(@".*?(\[.*?\])+.*?(?[\w\s]+?)[-\s_]+(?\d+).*$") { IsNamed = true },