diff options
Diffstat (limited to 'Emby.Server.Implementations')
6 files changed, 52 insertions, 32 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 550c16b4c..745753440 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -630,7 +630,7 @@ namespace Emby.Server.Implementations BaseItem.FileSystem = Resolve<IFileSystem>(); BaseItem.UserDataManager = Resolve<IUserDataManager>(); BaseItem.ChannelManager = Resolve<IChannelManager>(); - Video.LiveTvManager = Resolve<ILiveTvManager>(); + Video.RecordingsManager = Resolve<IRecordingsManager>(); Folder.UserViewManager = Resolve<IUserViewManager>(); UserView.TVSeriesManager = Resolve<ITVSeriesManager>(); UserView.CollectionManager = Resolve<ICollectionManager>(); diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index d0d5bb81c..7812687ea 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -18,7 +18,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.LiveTv; -using MediaBrowser.Controller.Lyrics; using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Playlists; using MediaBrowser.Controller.Providers; @@ -47,12 +46,12 @@ namespace Emby.Server.Implementations.Dto private readonly IImageProcessor _imageProcessor; private readonly IProviderManager _providerManager; + private readonly IRecordingsManager _recordingsManager; private readonly IApplicationHost _appHost; private readonly IMediaSourceManager _mediaSourceManager; private readonly Lazy<ILiveTvManager> _livetvManagerFactory; - private readonly ILyricManager _lyricManager; private readonly ITrickplayManager _trickplayManager; public DtoService( @@ -62,10 +61,10 @@ namespace Emby.Server.Implementations.Dto IItemRepository itemRepo, IImageProcessor imageProcessor, IProviderManager providerManager, + IRecordingsManager recordingsManager, IApplicationHost appHost, IMediaSourceManager mediaSourceManager, Lazy<ILiveTvManager> livetvManagerFactory, - ILyricManager lyricManager, ITrickplayManager trickplayManager) { _logger = logger; @@ -74,10 +73,10 @@ namespace Emby.Server.Implementations.Dto _itemRepo = itemRepo; _imageProcessor = imageProcessor; _providerManager = providerManager; + _recordingsManager = recordingsManager; _appHost = appHost; _mediaSourceManager = mediaSourceManager; _livetvManagerFactory = livetvManagerFactory; - _lyricManager = lyricManager; _trickplayManager = trickplayManager; } @@ -149,10 +148,6 @@ namespace Emby.Server.Implementations.Dto { LivetvManager.AddInfoToProgramDto(new[] { (item, dto) }, options.Fields, user).GetAwaiter().GetResult(); } - else if (item is Audio) - { - dto.HasLyrics = _lyricManager.HasLyricFile(item); - } if (item is IItemByName itemByName && options.ContainsField(ItemFields.ItemCounts)) @@ -256,8 +251,7 @@ namespace Emby.Server.Implementations.Dto dto.Etag = item.GetEtag(user); } - var liveTvManager = LivetvManager; - var activeRecording = liveTvManager.GetActiveRecordingInfo(item.Path); + var activeRecording = _recordingsManager.GetActiveRecordingInfo(item.Path); if (activeRecording is not null) { dto.Type = BaseItemKind.Recording; @@ -270,7 +264,12 @@ namespace Emby.Server.Implementations.Dto dto.Name = dto.SeriesName; } - liveTvManager.AddInfoToRecordingDto(item, dto, activeRecording, user); + LivetvManager.AddInfoToRecordingDto(item, dto, activeRecording, user); + } + + if (item is Audio audio) + { + dto.HasLyrics = audio.GetMediaStreams().Any(s => s.Type == MediaStreamType.Lyric); } return dto; diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 7998ce34a..a2abafd2a 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -1232,6 +1232,19 @@ namespace Emby.Server.Implementations.Library return item; } + /// <inheritdoc /> + public T GetItemById<T>(Guid id) + where T : BaseItem + { + var item = GetItemById(id); + if (item is T typedItem) + { + return typedItem; + } + + return null; + } + public List<BaseItem> GetItemList(InternalItemsQuery query, bool allowExternalContent) { if (query.Recursive && !query.ParentId.IsEmpty()) @@ -1847,7 +1860,7 @@ namespace Emby.Server.Implementations.Library try { var index = item.GetImageIndex(img); - image = await ConvertImageToLocal(item, img, index).ConfigureAwait(false); + image = await ConvertImageToLocal(item, img, index, removeOnFailure: true).ConfigureAwait(false); } catch (ArgumentException) { @@ -2774,7 +2787,7 @@ namespace Emby.Server.Implementations.Library await SavePeopleMetadataAsync(people, cancellationToken).ConfigureAwait(false); } - public async Task<ItemImageInfo> ConvertImageToLocal(BaseItem item, ItemImageInfo image, int imageIndex) + public async Task<ItemImageInfo> ConvertImageToLocal(BaseItem item, ItemImageInfo image, int imageIndex, bool removeOnFailure) { foreach (var url in image.Path.Split('|')) { @@ -2793,6 +2806,7 @@ namespace Emby.Server.Implementations.Library if (ex.StatusCode.HasValue && (ex.StatusCode.Value == HttpStatusCode.NotFound || ex.StatusCode.Value == HttpStatusCode.Forbidden)) { + _logger.LogDebug(ex, "Error downloading image {Url}", url); continue; } @@ -2800,11 +2814,14 @@ namespace Emby.Server.Implementations.Library } } - // Remove this image to prevent it from retrying over and over - item.RemoveImage(image); - await item.UpdateToRepositoryAsync(ItemUpdateType.ImageUpdate, CancellationToken.None).ConfigureAwait(false); + if (removeOnFailure) + { + // Remove this image to prevent it from retrying over and over + item.RemoveImage(image); + await item.UpdateToRepositoryAsync(ItemUpdateType.ImageUpdate, CancellationToken.None).ConfigureAwait(false); + } - throw new InvalidOperationException(); + throw new InvalidOperationException("Unable to convert any images to local"); } public async Task AddVirtualFolder(string name, CollectionTypeOptions? collectionType, LibraryOptions options, bool refreshLibrary) diff --git a/Emby.Server.Implementations/Localization/Core/ga.json b/Emby.Server.Implementations/Localization/Core/ga.json new file mode 100644 index 000000000..28e54bff5 --- /dev/null +++ b/Emby.Server.Implementations/Localization/Core/ga.json @@ -0,0 +1,3 @@ +{ + "Albums": "Albaim" +} diff --git a/Emby.Server.Implementations/Localization/Core/hi.json b/Emby.Server.Implementations/Localization/Core/hi.json index 3f4dea523..a28352219 100644 --- a/Emby.Server.Implementations/Localization/Core/hi.json +++ b/Emby.Server.Implementations/Localization/Core/hi.json @@ -4,27 +4,27 @@ "HeaderNextUp": "इसके बाद", "HeaderLiveTV": "लाइव टीवी", "HeaderFavoriteSongs": "पसंदीदा गीत", - "HeaderFavoriteShows": "पसंदीदा शोज", - "HeaderFavoriteEpisodes": "पसंदीदा एपिसोड्स", - "HeaderFavoriteArtists": "पसंदीदा कलाकारसमूह", + "HeaderFavoriteShows": "पसंदीदा शो", + "HeaderFavoriteEpisodes": "पसंदीदा प्रकरण", + "HeaderFavoriteArtists": "पसंदीदा कलाकार", "HeaderFavoriteAlbums": "पसंदीदा एलबम्स", - "HeaderContinueWatching": "देखते रहिए", + "HeaderContinueWatching": "देखना जारी रखें", "HeaderAlbumArtists": "एल्बम कलाकार", - "Genres": "शैली", + "Genres": "शैलियां", "Forced": "बलपूर्वक", - "Folders": "फ़ोल्डरें", + "Folders": "फ़ोल्डर", "Favorites": "पसंदीदा", "FailedLoginAttemptWithUserName": "{0} से लॉगिन असफल हुआ", - "DeviceOnlineWithName": "{0} से संयोग हो गया है", - "DeviceOfflineWithName": "{0} से संयोग विच्छिन्न हो गया है", + "DeviceOnlineWithName": "{0} कनेक्ट हो गया है", + "DeviceOfflineWithName": "{0} डिस्कनेक्ट हो गया है", "Default": "प्राथमिक", - "Collections": "संग्रहों", - "ChapterNameValue": "अध्याय", + "Collections": "संग्रह", + "ChapterNameValue": "अध्याय {0}", "Channels": "चैनल", - "CameraImageUploadedFrom": "{0} से एक नया कैमरावाला चित्र अपलोड किया गया है", - "Books": "पुस्तकों", - "AuthenticationSucceededWithUserName": "सफलता से प्रमाणीकृत", - "Artists": "कलाकारों", + "CameraImageUploadedFrom": "{0} से एक नया कैमरा छवि अपलोड की गई है", + "Books": "पुस्तकें", + "AuthenticationSucceededWithUserName": "{0} सफलतापूर्वक प्रमाणित किया गया", + "Artists": "कलाकार", "Application": "एप्लिकेशन", "AppDeviceValues": "एप: {0}, उपकरण: {1}", "NotificationOptionPluginUninstalled": "प्लगइन अनइंस्टाल हो गया", diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index bbb3938dc..40b3b0339 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -394,6 +394,7 @@ namespace Emby.Server.Implementations.Session session.PlayState.SubtitleStreamIndex = info.SubtitleStreamIndex; session.PlayState.PlayMethod = info.PlayMethod; session.PlayState.RepeatMode = info.RepeatMode; + session.PlayState.PlaybackOrder = info.PlaybackOrder; session.PlaylistItemId = info.PlaylistItemId; var nowPlayingQueue = info.NowPlayingQueue; |
