mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-02 18:47:18 -05:00 
			
		
		
		
	Add IsAutomated to SubtitleSearchRequest
This commit is contained in:
		
							parent
							
								
									8388f7c462
								
							
						
					
					
						commit
						ade3afad41
					
				@ -149,6 +149,7 @@
 | 
				
			|||||||
 - [skyfrk](https://github.com/skyfrk)
 | 
					 - [skyfrk](https://github.com/skyfrk)
 | 
				
			||||||
 - [ianjazz246](https://github.com/ianjazz246)
 | 
					 - [ianjazz246](https://github.com/ianjazz246)
 | 
				
			||||||
 - [peterspenler](https://github.com/peterspenler)
 | 
					 - [peterspenler](https://github.com/peterspenler)
 | 
				
			||||||
 | 
					 - [MBR-0001](https://github.com/MBR-0001)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Emby Contributors
 | 
					# Emby Contributors
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -127,7 +127,7 @@ namespace Jellyfin.Api.Controllers
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            var video = (Video)_libraryManager.GetItemById(itemId);
 | 
					            var video = (Video)_libraryManager.GetItemById(itemId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return await _subtitleManager.SearchSubtitles(video, language, isPerfectMatch, CancellationToken.None).ConfigureAwait(false);
 | 
					            return await _subtitleManager.SearchSubtitles(video, language, isPerfectMatch, false, CancellationToken.None).ConfigureAwait(false);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -31,12 +31,14 @@ namespace MediaBrowser.Controller.Subtitles
 | 
				
			|||||||
        /// <param name="video">The video.</param>
 | 
					        /// <param name="video">The video.</param>
 | 
				
			||||||
        /// <param name="language">Subtitle language.</param>
 | 
					        /// <param name="language">Subtitle language.</param>
 | 
				
			||||||
        /// <param name="isPerfectMatch">Require perfect match.</param>
 | 
					        /// <param name="isPerfectMatch">Require perfect match.</param>
 | 
				
			||||||
 | 
					        /// <param name="isAutomated">Request is automated.</param>
 | 
				
			||||||
        /// <param name="cancellationToken">CancellationToken to use for the operation.</param>
 | 
					        /// <param name="cancellationToken">CancellationToken to use for the operation.</param>
 | 
				
			||||||
        /// <returns>Subtitles, wrapped in task.</returns>
 | 
					        /// <returns>Subtitles, wrapped in task.</returns>
 | 
				
			||||||
        Task<RemoteSubtitleInfo[]> SearchSubtitles(
 | 
					        Task<RemoteSubtitleInfo[]> SearchSubtitles(
 | 
				
			||||||
            Video video,
 | 
					            Video video,
 | 
				
			||||||
            string language,
 | 
					            string language,
 | 
				
			||||||
            bool? isPerfectMatch,
 | 
					            bool? isPerfectMatch,
 | 
				
			||||||
 | 
					            bool isAutomated,
 | 
				
			||||||
            CancellationToken cancellationToken);
 | 
					            CancellationToken cancellationToken);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -51,5 +51,7 @@ namespace MediaBrowser.Controller.Subtitles
 | 
				
			|||||||
        public string[] DisabledSubtitleFetchers { get; set; }
 | 
					        public string[] DisabledSubtitleFetchers { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string[] SubtitleFetcherOrder { get; set; }
 | 
					        public string[] SubtitleFetcherOrder { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool IsAutomated { get; set; }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -557,6 +557,7 @@ namespace MediaBrowser.Providers.MediaInfo
 | 
				
			|||||||
                        subtitleDownloadLanguages,
 | 
					                        subtitleDownloadLanguages,
 | 
				
			||||||
                        libraryOptions.DisabledSubtitleFetchers,
 | 
					                        libraryOptions.DisabledSubtitleFetchers,
 | 
				
			||||||
                        libraryOptions.SubtitleFetcherOrder,
 | 
					                        libraryOptions.SubtitleFetcherOrder,
 | 
				
			||||||
 | 
					                        true,
 | 
				
			||||||
                        cancellationToken).ConfigureAwait(false);
 | 
					                        cancellationToken).ConfigureAwait(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                // Rescan
 | 
					                // Rescan
 | 
				
			||||||
 | 
				
			|||||||
@ -36,6 +36,7 @@ namespace MediaBrowser.Providers.MediaInfo
 | 
				
			|||||||
            IEnumerable<string> languages,
 | 
					            IEnumerable<string> languages,
 | 
				
			||||||
            string[] disabledSubtitleFetchers,
 | 
					            string[] disabledSubtitleFetchers,
 | 
				
			||||||
            string[] subtitleFetcherOrder,
 | 
					            string[] subtitleFetcherOrder,
 | 
				
			||||||
 | 
					            bool isAutomated,
 | 
				
			||||||
            CancellationToken cancellationToken)
 | 
					            CancellationToken cancellationToken)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var downloadedLanguages = new List<string>();
 | 
					            var downloadedLanguages = new List<string>();
 | 
				
			||||||
@ -51,6 +52,7 @@ namespace MediaBrowser.Providers.MediaInfo
 | 
				
			|||||||
                    lang,
 | 
					                    lang,
 | 
				
			||||||
                    disabledSubtitleFetchers,
 | 
					                    disabledSubtitleFetchers,
 | 
				
			||||||
                    subtitleFetcherOrder,
 | 
					                    subtitleFetcherOrder,
 | 
				
			||||||
 | 
					                    isAutomated,
 | 
				
			||||||
                    cancellationToken).ConfigureAwait(false);
 | 
					                    cancellationToken).ConfigureAwait(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (downloaded)
 | 
					                if (downloaded)
 | 
				
			||||||
@ -71,6 +73,7 @@ namespace MediaBrowser.Providers.MediaInfo
 | 
				
			|||||||
            string lang,
 | 
					            string lang,
 | 
				
			||||||
            string[] disabledSubtitleFetchers,
 | 
					            string[] disabledSubtitleFetchers,
 | 
				
			||||||
            string[] subtitleFetcherOrder,
 | 
					            string[] subtitleFetcherOrder,
 | 
				
			||||||
 | 
					            bool isAutomated,
 | 
				
			||||||
            CancellationToken cancellationToken)
 | 
					            CancellationToken cancellationToken)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (video.VideoType != VideoType.VideoFile)
 | 
					            if (video.VideoType != VideoType.VideoFile)
 | 
				
			||||||
@ -109,6 +112,7 @@ namespace MediaBrowser.Providers.MediaInfo
 | 
				
			|||||||
                disabledSubtitleFetchers,
 | 
					                disabledSubtitleFetchers,
 | 
				
			||||||
                subtitleFetcherOrder,
 | 
					                subtitleFetcherOrder,
 | 
				
			||||||
                mediaType,
 | 
					                mediaType,
 | 
				
			||||||
 | 
					                isAutomated,
 | 
				
			||||||
                cancellationToken);
 | 
					                cancellationToken);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -122,6 +126,7 @@ namespace MediaBrowser.Providers.MediaInfo
 | 
				
			|||||||
            string[] disabledSubtitleFetchers,
 | 
					            string[] disabledSubtitleFetchers,
 | 
				
			||||||
            string[] subtitleFetcherOrder,
 | 
					            string[] subtitleFetcherOrder,
 | 
				
			||||||
            VideoContentType mediaType,
 | 
					            VideoContentType mediaType,
 | 
				
			||||||
 | 
					            bool isAutomated,
 | 
				
			||||||
            CancellationToken cancellationToken)
 | 
					            CancellationToken cancellationToken)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            // There's already subtitles for this language
 | 
					            // There's already subtitles for this language
 | 
				
			||||||
@ -169,7 +174,8 @@ namespace MediaBrowser.Providers.MediaInfo
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                IsPerfectMatch = requirePerfectMatch,
 | 
					                IsPerfectMatch = requirePerfectMatch,
 | 
				
			||||||
                DisabledSubtitleFetchers = disabledSubtitleFetchers,
 | 
					                DisabledSubtitleFetchers = disabledSubtitleFetchers,
 | 
				
			||||||
                SubtitleFetcherOrder = subtitleFetcherOrder
 | 
					                SubtitleFetcherOrder = subtitleFetcherOrder,
 | 
				
			||||||
 | 
					                IsAutomated = isAutomated
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (video is Episode episode)
 | 
					            if (video is Episode episode)
 | 
				
			||||||
 | 
				
			|||||||
@ -197,6 +197,7 @@ namespace MediaBrowser.Providers.MediaInfo
 | 
				
			|||||||
                    subtitleDownloadLanguages,
 | 
					                    subtitleDownloadLanguages,
 | 
				
			||||||
                    libraryOptions.DisabledSubtitleFetchers,
 | 
					                    libraryOptions.DisabledSubtitleFetchers,
 | 
				
			||||||
                    libraryOptions.SubtitleFetcherOrder,
 | 
					                    libraryOptions.SubtitleFetcherOrder,
 | 
				
			||||||
 | 
					                    true,
 | 
				
			||||||
                    cancellationToken).ConfigureAwait(false);
 | 
					                    cancellationToken).ConfigureAwait(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // Rescan
 | 
					            // Rescan
 | 
				
			||||||
 | 
				
			|||||||
@ -274,7 +274,7 @@ namespace MediaBrowser.Providers.Subtitles
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <inheritdoc />
 | 
					        /// <inheritdoc />
 | 
				
			||||||
        public Task<RemoteSubtitleInfo[]> SearchSubtitles(Video video, string language, bool? isPerfectMatch, CancellationToken cancellationToken)
 | 
					        public Task<RemoteSubtitleInfo[]> SearchSubtitles(Video video, string language, bool? isPerfectMatch, bool isAutomated, CancellationToken cancellationToken)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (video.VideoType != VideoType.VideoFile)
 | 
					            if (video.VideoType != VideoType.VideoFile)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
@ -308,7 +308,8 @@ namespace MediaBrowser.Providers.Subtitles
 | 
				
			|||||||
                ProductionYear = video.ProductionYear,
 | 
					                ProductionYear = video.ProductionYear,
 | 
				
			||||||
                ProviderIds = video.ProviderIds,
 | 
					                ProviderIds = video.ProviderIds,
 | 
				
			||||||
                RuntimeTicks = video.RunTimeTicks,
 | 
					                RuntimeTicks = video.RunTimeTicks,
 | 
				
			||||||
                IsPerfectMatch = isPerfectMatch ?? false
 | 
					                IsPerfectMatch = isPerfectMatch ?? false,
 | 
				
			||||||
 | 
					                IsAutomated = isAutomated
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (video is Episode episode)
 | 
					            if (video is Episode episode)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user