Пример #1
0
        private void MergeVideos(IEnumerable <BaseItem> videos)
        {
            List <BaseItem> elegibleToMerge = new List <BaseItem>();

            foreach (var video in videos)
            {
                if (isElegible(video))
                {
                    elegibleToMerge.Add(video);
                }
            }

            var mv = new MediaBrowser.Api.MergeVersions
            {
                Ids = String.Join(',', elegibleToMerge.Select(m => m.Id))
            };

            if (elegibleToMerge.Count() > 1)
            {
                _logger.LogInformation($"Merging {videos.ElementAt(0).OriginalTitle} ({videos.ElementAt(0).ProductionYear})");
                _logger.LogDebug($"ids are {mv.Ids}\nMerging...");
                _videoService.Post(mv);
                _logger.LogDebug("merged");
            }
        }
        private void MergeMovies(IEnumerable <BaseItem> movies)
        {
            var mv = new MediaBrowser.Api.MergeVersions
            {
                Ids = String.Join(',', movies.Select(m => m.Id))
            };

            _logger.LogDebug($"ids are {mv.Ids}\nMerging...");
            _videoService.Post(mv);
            _logger.LogDebug("merged");
        }