aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/ConfigurationOptions.cs1
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs3
-rw-r--r--Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs63
-rw-r--r--Emby.Server.Implementations/Localization/Core/he.json6
-rw-r--r--Emby.Server.Implementations/Localization/Core/hu.json10
-rw-r--r--Emby.Server.Implementations/Localization/Core/id.json3
-rw-r--r--Emby.Server.Implementations/Localization/Core/mk.json96
-rw-r--r--Emby.Server.Implementations/Sorting/AlphanumComparator.cs99
8 files changed, 140 insertions, 141 deletions
diff --git a/Emby.Server.Implementations/ConfigurationOptions.cs b/Emby.Server.Implementations/ConfigurationOptions.cs
index 2ea7ff6e9..d0f3d6723 100644
--- a/Emby.Server.Implementations/ConfigurationOptions.cs
+++ b/Emby.Server.Implementations/ConfigurationOptions.cs
@@ -8,7 +8,6 @@ namespace Emby.Server.Implementations
public static Dictionary<string, string> Configuration => new Dictionary<string, string>
{
{ "HttpListenerHost:DefaultRedirectPath", "web/index.html" },
- { "MusicBrainz:BaseUrl", "https://www.musicbrainz.org" },
{ FfmpegProbeSizeKey, "1G" },
{ FfmpegAnalyzeDurationKey, "200M" }
};
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 5d16a9050..5f7f5b2f0 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -944,7 +944,6 @@ namespace Emby.Server.Implementations.Library
IncludeItemTypes = new[] { typeof(T).Name },
Name = name,
DtoOptions = options
-
}).Cast<MusicArtist>()
.OrderBy(i => i.IsAccessedByName ? 1 : 0)
.Cast<T>()
@@ -1080,7 +1079,7 @@ namespace Emby.Server.Implementations.Library
var innerProgress = new ActionableProgress<double>();
- innerProgress.RegisterAction(pct => progress.Report(pct * pct * 0.96));
+ innerProgress.RegisterAction(pct => progress.Report(pct * 0.96));
// Validate the entire media library
await RootFolder.ValidateChildren(innerProgress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(_fileSystem)), recursive: true).ConfigureAwait(false);
diff --git a/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs b/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs
index 5e672f221..fa6d57466 100644
--- a/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/PlaylistResolver.cs
@@ -1,65 +1,68 @@
-#pragma warning disable CS1591
-#pragma warning disable SA1600
-
using System;
using System.IO;
using System.Linq;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Playlists;
+using MediaBrowser.Controller.Resolvers;
+using MediaBrowser.LocalMetadata.Savers;
using MediaBrowser.Model.Entities;
namespace Emby.Server.Implementations.Library.Resolvers
{
+ /// <summary>
+ /// <see cref="IItemResolver"/> for <see cref="Playlist"/> library items.
+ /// </summary>
public class PlaylistResolver : FolderResolver<Playlist>
{
- private string[] SupportedCollectionTypes = new string[] {
-
+ private string[] _musicPlaylistCollectionTypes = new string[] {
string.Empty,
CollectionType.Music
};
- /// <summary>
- /// Resolves the specified args.
- /// </summary>
- /// <param name="args">The args.</param>
- /// <returns>BoxSet.</returns>
+ /// <inheritdoc/>
protected override Playlist Resolve(ItemResolveArgs args)
{
- // It's a boxset if all of the following conditions are met:
- // Is a Directory
- // Contains [playlist] in the path
if (args.IsDirectory)
{
- var filename = Path.GetFileName(args.Path);
-
- if (string.IsNullOrEmpty(filename))
+ // It's a boxset if the path is a directory with [playlist] in it's the name
+ // TODO: Should this use Path.GetDirectoryName() instead?
+ bool isBoxSet = Path.GetFileName(args.Path)
+ ?.Contains("[playlist]", StringComparison.OrdinalIgnoreCase)
+ ?? false;
+ if (isBoxSet)
{
- return null;
+ return new Playlist
+ {
+ Path = args.Path,
+ Name = Path.GetFileName(args.Path).Replace("[playlist]", string.Empty, StringComparison.OrdinalIgnoreCase).Trim()
+ };
}
- if (filename.IndexOf("[playlist]", StringComparison.OrdinalIgnoreCase) != -1)
+ // It's a directory-based playlist if the directory contains a playlist file
+ var filePaths = Directory.EnumerateFiles(args.Path);
+ if (filePaths.Any(f => f.EndsWith(PlaylistXmlSaver.DefaultPlaylistFilename, StringComparison.OrdinalIgnoreCase)))
{
return new Playlist
{
Path = args.Path,
- Name = Path.GetFileName(args.Path).Replace("[playlist]", string.Empty, StringComparison.OrdinalIgnoreCase).Trim()
+ Name = Path.GetFileName(args.Path)
};
}
}
- else
+
+ // Check if this is a music playlist file
+ // It should have the correct collection type and a supported file extension
+ else if (_musicPlaylistCollectionTypes.Contains(args.CollectionType ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
- if (SupportedCollectionTypes.Contains(args.CollectionType ?? string.Empty, StringComparer.OrdinalIgnoreCase))
+ var extension = Path.GetExtension(args.Path);
+ if (Playlist.SupportedExtensions.Contains(extension ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
- var extension = Path.GetExtension(args.Path);
- if (Playlist.SupportedExtensions.Contains(extension ?? string.Empty, StringComparer.OrdinalIgnoreCase))
+ return new Playlist
{
- return new Playlist
- {
- Path = args.Path,
- Name = Path.GetFileNameWithoutExtension(args.Path),
- IsInMixedFolder = true
- };
- }
+ Path = args.Path,
+ Name = Path.GetFileNameWithoutExtension(args.Path),
+ IsInMixedFolder = true
+ };
}
}
diff --git a/Emby.Server.Implementations/Localization/Core/he.json b/Emby.Server.Implementations/Localization/Core/he.json
index 5ef59797d..f3a7794da 100644
--- a/Emby.Server.Implementations/Localization/Core/he.json
+++ b/Emby.Server.Implementations/Localization/Core/he.json
@@ -81,9 +81,9 @@
"System": "System",
"TvShows": "סדרות טלוויזיה",
"User": "User",
- "UserCreatedWithName": "User {0} has been created",
- "UserDeletedWithName": "User {0} has been deleted",
- "UserDownloadingItemWithValues": "{0} is downloading {1}",
+ "UserCreatedWithName": "המשתמש {0} נוצר",
+ "UserDeletedWithName": "המשתמש {0} הוסר",
+ "UserDownloadingItemWithValues": "{0} מוריד את {1}",
"UserLockedOutWithName": "User {0} has been locked out",
"UserOfflineFromDevice": "{0} has disconnected from {1}",
"UserOnlineFromDevice": "{0} is online from {1}",
diff --git a/Emby.Server.Implementations/Localization/Core/hu.json b/Emby.Server.Implementations/Localization/Core/hu.json
index 950be68d0..6017aa7f9 100644
--- a/Emby.Server.Implementations/Localization/Core/hu.json
+++ b/Emby.Server.Implementations/Localization/Core/hu.json
@@ -11,7 +11,7 @@
"Collections": "Gyűjtemények",
"DeviceOfflineWithName": "{0} kijelentkezett",
"DeviceOnlineWithName": "{0} belépett",
- "FailedLoginAttemptWithUserName": "Sikertelen bejelentkezési kísérlet {0}",
+ "FailedLoginAttemptWithUserName": "Sikertelen bejelentkezési kísérlet tőle: {0}",
"Favorites": "Kedvencek",
"Folders": "Könyvtárak",
"Genres": "Műfajok",
@@ -27,7 +27,7 @@
"HeaderNextUp": "Következik",
"HeaderRecordingGroups": "Felvételi csoportok",
"HomeVideos": "Házi videók",
- "Inherit": "Öröklés",
+ "Inherit": "Örökölt",
"ItemAddedWithName": "{0} hozzáadva a könyvtárhoz",
"ItemRemovedWithName": "{0} eltávolítva a könyvtárból",
"LabelIpAddressValue": "IP cím: {0}",
@@ -73,7 +73,7 @@
"ServerNameNeedsToBeRestarted": "{0}-t újra kell indítani",
"Shows": "Műsorok",
"Songs": "Dalok",
- "StartupEmbyServerIsLoading": "A Jellyfin Szerver betöltődik. Kérlek próbáld újra később.",
+ "StartupEmbyServerIsLoading": "A Jellyfin Szerver betöltődik. Kérlek, próbáld újra hamarosan.",
"SubtitleDownloadFailureForItem": "Subtitles failed to download for {0}",
"SubtitleDownloadFailureFromForItem": "Nem sikerült a felirat letöltése innen: {0} ehhez: {1}",
"SubtitlesDownloadedForItem": "Letöltött feliratok a következőhöz: {0}",
@@ -86,11 +86,11 @@
"UserDownloadingItemWithValues": "{0} letölti {1}",
"UserLockedOutWithName": "{0} felhasználó zárolva van",
"UserOfflineFromDevice": "{0} kijelentkezett innen: {1}",
- "UserOnlineFromDevice": "{0} online itt: {1}",
+ "UserOnlineFromDevice": "{0} online innen: {1}",
"UserPasswordChangedWithName": "Jelszó megváltozott a következő felhasználó számára: {0}",
"UserPolicyUpdatedWithName": "A felhasználói házirend frissítve lett neki: {0}",
"UserStartedPlayingItemWithValues": "{0} elkezdte játszani a következőt: {1} itt: {2}",
- "UserStoppedPlayingItemWithValues": "{0} befejezte a következőt: {1} itt: {2}",
+ "UserStoppedPlayingItemWithValues": "{0} befejezte {1} lejátászását itt: {2}",
"ValueHasBeenAddedToLibrary": "{0} hozzáadva a médiatárhoz",
"ValueSpecialEpisodeName": "Special - {0}",
"VersionNumber": "Verzió: {0}"
diff --git a/Emby.Server.Implementations/Localization/Core/id.json b/Emby.Server.Implementations/Localization/Core/id.json
index 38c6cf54f..68fffbf0a 100644
--- a/Emby.Server.Implementations/Localization/Core/id.json
+++ b/Emby.Server.Implementations/Localization/Core/id.json
@@ -91,5 +91,6 @@
"NotificationOptionVideoPlayback": "Pemutaran video dimulai",
"NotificationOptionAudioPlaybackStopped": "Pemutaran audio berhenti",
"NotificationOptionAudioPlayback": "Pemutaran audio dimulai",
- "MixedContent": "Konten campur"
+ "MixedContent": "Konten campur",
+ "PluginUninstalledWithName": "{0} telah dihapus"
}
diff --git a/Emby.Server.Implementations/Localization/Core/mk.json b/Emby.Server.Implementations/Localization/Core/mk.json
new file mode 100644
index 000000000..684a97aad
--- /dev/null
+++ b/Emby.Server.Implementations/Localization/Core/mk.json
@@ -0,0 +1,96 @@
+{
+ "ScheduledTaskFailedWithName": "{0} неуспешно",
+ "ProviderValue": "Провајдер: {0}",
+ "PluginUpdatedWithName": "{0} беше надоградено",
+ "PluginUninstalledWithName": "{0} беше успешно деинсталирано",
+ "PluginInstalledWithName": "{0} беше успешно инсталирано",
+ "Plugin": "Додатоци",
+ "Playlists": "Листи",
+ "Photos": "Слики",
+ "NotificationOptionVideoPlaybackStopped": "Видео стопирано",
+ "NotificationOptionVideoPlayback": "Видео пуштено",
+ "NotificationOptionUserLockedOut": "Корисникот е ослободен",
+ "NotificationOptionTaskFailed": "Закажани задачи неуспешно",
+ "NotificationOptionServerRestartRequired": "Задолжително рестартирање на серверот",
+ "NotificationOptionPluginUpdateInstalled": "Надоградба на Додаток успешна",
+ "NotificationOptionPluginUninstalled": "Додаток успешно деинсталиран",
+ "NotificationOptionPluginInstalled": "Додаток успешно инсталиран",
+ "NotificationOptionPluginError": "Грешка на додаток",
+ "NotificationOptionNewLibraryContent": "Додадена нова содржина",
+ "NotificationOptionInstallationFailed": "Неуспешна Инсталација",
+ "NotificationOptionCameraImageUploaded": "Слика од камера поставена",
+ "NotificationOptionAudioPlaybackStopped": "Аудио стопирано",
+ "NotificationOptionAudioPlayback": "Аудио стартувано",
+ "NotificationOptionApplicationUpdateInstalled": "Надоградбата на Апликацијата е иснталирана",
+ "NotificationOptionApplicationUpdateAvailable": "Возможна надоградба на Апликацијата",
+ "NewVersionIsAvailable": "Нова верзија од Jellyfin е возможна за спуштање.",
+ "NameSeasonUnknown": "Непозната Сезона",
+ "NameSeasonNumber": "Сезона {0}",
+ "NameInstallFailed": "{0} неуспешна инсталација",
+ "MusicVideos": "Музички видеа",
+ "Music": "Музика",
+ "Movies": "Филмови",
+ "MixedContent": "Мешана содржина",
+ "MessageServerConfigurationUpdated": "Серверската конфигурација беше надградена",
+ "MessageNamedServerConfigurationUpdatedWithValue": "Секцијата на конфигурација на сервер {0} беше надоградена",
+ "MessageApplicationUpdatedTo": "Jellyfin беше надограден до {0}",
+ "MessageApplicationUpdated": "Jellyfin Серверот беше надограден",
+ "Latest": "Последно",
+ "LabelRunningTimeValue": "Време на работа: {0}",
+ "LabelIpAddressValue": "ИП Адреса: {0}",
+ "ItemRemovedWithName": "{0} е избришано до Библиотеката",
+ "ItemAddedWithName": "{0} беше додадено во Библиотеката",
+ "Inherit": "Следно",
+ "HomeVideos": "Домашни Видеа",
+ "HeaderRecordingGroups": "Групи на снимање",
+ "HeaderNextUp": "Следно",
+ "HeaderLiveTV": "ТВ",
+ "HeaderFavoriteSongs": "Омилени Песни",
+ "HeaderFavoriteShows": "Омилени Серии",
+ "HeaderFavoriteEpisodes": "Омилени Епизоди",
+ "HeaderFavoriteArtists": "Омилени Изведувачи",
+ "HeaderFavoriteAlbums": "Омилени Албуми",
+ "HeaderContinueWatching": "Продолжи со гледање",
+ "HeaderCameraUploads": "Поставувања од камера",
+ "HeaderAlbumArtists": "Изведувачи од Албуми",
+ "Genres": "Жанрови",
+ "Folders": "Папки",
+ "Favorites": "Омилени",
+ "FailedLoginAttemptWithUserName": "Неуспешно поврзување од {0}",
+ "DeviceOnlineWithName": "{0} е приклучен",
+ "DeviceOfflineWithName": "{0} се исклучи",
+ "Collections": "Колекции",
+ "ChapterNameValue": "Дел {0}",
+ "Channels": "Канали",
+ "CameraImageUploadedFrom": "Нова слика од камера беше поставена од {0}",
+ "Books": "Книги",
+ "AuthenticationSucceededWithUserName": "{0} успешно поврзан",
+ "Artists": "Изведувач",
+ "Application": "Апликација",
+ "AppDeviceValues": "Аплиакција: {0}, Уред: {1}",
+ "Albums": "Албуми",
+ "VersionNumber": "Верзија {0}",
+ "ValueSpecialEpisodeName": "Специјално - {0}",
+ "ValueHasBeenAddedToLibrary": "{0} е додадено во твојата библиотека",
+ "UserStoppedPlayingItemWithValues": "{0} заврши со репродукција {1} во {2}",
+ "UserStartedPlayingItemWithValues": "{0} пушти {1} на {2}",
+ "UserPolicyUpdatedWithName": "Полисата на користење беше надоградена за {0}",
+ "UserPasswordChangedWithName": "Лозинката е сменета за корисникот {0}",
+ "UserOnlineFromDevice": "{0} е приклучен од {1}",
+ "UserOfflineFromDevice": "{0} е дисконектиран од {1}",
+ "UserLockedOutWithName": "Корисникот {0} е заклучен",
+ "UserDownloadingItemWithValues": "{0} се спушта {1}",
+ "UserDeletedWithName": "Корисникот {0} е избришан",
+ "UserCreatedWithName": "Корисникот {0} е креиран",
+ "User": "Корисник",
+ "TvShows": "ТВ Серии",
+ "System": "Систем",
+ "Sync": "Синхронизација",
+ "SubtitlesDownloadedForItem": "Спуштање превод за {0}",
+ "SubtitleDownloadFailureFromForItem": "Преводот неуспешно се спушти од {0} за {1}",
+ "StartupEmbyServerIsLoading": "Jellyfin Server се пушта. Ве молиме причекајте.",
+ "Songs": "Песни",
+ "Shows": "Серии",
+ "ServerNameNeedsToBeRestarted": "{0} треба да се рестартира",
+ "ScheduledTaskStartedWithName": "{0} започна"
+}
diff --git a/Emby.Server.Implementations/Sorting/AlphanumComparator.cs b/Emby.Server.Implementations/Sorting/AlphanumComparator.cs
deleted file mode 100644
index 2e00c24d7..000000000
--- a/Emby.Server.Implementations/Sorting/AlphanumComparator.cs
+++ /dev/null
@@ -1,99 +0,0 @@
-using System.Collections.Generic;
-using System.Text;
-using MediaBrowser.Controller.Sorting;
-
-namespace Emby.Server.Implementations.Sorting
-{
- public class AlphanumComparator : IComparer<string>
- {
- public static int CompareValues(string s1, string s2)
- {
- if (s1 == null || s2 == null)
- {
- return 0;
- }
-
- int thisMarker = 0, thisNumericChunk = 0;
- int thatMarker = 0, thatNumericChunk = 0;
-
- while ((thisMarker < s1.Length) || (thatMarker < s2.Length))
- {
- if (thisMarker >= s1.Length)
- {
- return -1;
- }
- else if (thatMarker >= s2.Length)
- {
- return 1;
- }
- char thisCh = s1[thisMarker];
- char thatCh = s2[thatMarker];
-
- var thisChunk = new StringBuilder();
- var thatChunk = new StringBuilder();
-
- while ((thisMarker < s1.Length) && (thisChunk.Length == 0 || SortHelper.InChunk(thisCh, thisChunk[0])))
- {
- thisChunk.Append(thisCh);
- thisMarker++;
-
- if (thisMarker < s1.Length)
- {
- thisCh = s1[thisMarker];
- }
- }
-
- while ((thatMarker < s2.Length) && (thatChunk.Length == 0 || SortHelper.InChunk(thatCh, thatChunk[0])))
- {
- thatChunk.Append(thatCh);
- thatMarker++;
-
- if (thatMarker < s2.Length)
- {
- thatCh = s2[thatMarker];
- }
- }
-
- int result = 0;
- // If both chunks contain numeric characters, sort them numerically
- if (char.IsDigit(thisChunk[0]) && char.IsDigit(thatChunk[0]))
- {
- if (!int.TryParse(thisChunk.ToString(), out thisNumericChunk))
- {
- return 0;
- }
- if (!int.TryParse(thatChunk.ToString(), out thatNumericChunk))
- {
- return 0;
- }
-
- if (thisNumericChunk < thatNumericChunk)
- {
- result = -1;
- }
-
- if (thisNumericChunk > thatNumericChunk)
- {
- result = 1;
- }
- }
- else
- {
- result = thisChunk.ToString().CompareTo(thatChunk.ToString());
- }
-
- if (result != 0)
- {
- return result;
- }
- }
-
- return 0;
- }
-
- public int Compare(string x, string y)
- {
- return CompareValues(x, y);
- }
- }
-}