Esempio n. 1
0
        private string ReplaceCommonPlaceholders(string fsPart, ReleaseMedium releaseMedium)
        {
            Replace(ref fsPart, "volume",   _job.Disc.Metadata.Derived.VolumeLabel);
            Replace(ref fsPart, "title",    releaseMedium.Title);
            Replace(ref fsPart, "res",      GetVideoResolution());
            Replace(ref fsPart, "vcodec",   GetVideoCodec());
            Replace(ref fsPart, "acodec",   GetAudioCodec());
            Replace(ref fsPart, "channels", GetChannelCount());
            Replace(ref fsPart, "cut",      GetCut());
            Replace(ref fsPart, "vlang",    GetVideoLanguage());
            Replace(ref fsPart, "alang",    GetAudioLanguage());

            fsPart = Environment.ExpandEnvironmentVariables(fsPart);

            return fsPart;
        }
Esempio n. 2
0
        private void OnExited(NonInteractiveProcessState processState, int exitCode, ReleaseMedium releaseMedium, Playlist playlist, List<Track> selectedTracks, string outputMKVPath)
        {
            LogExit(processState, exitCode);

            _tempFileRegistrar.DeleteTempFiles(_progressFilePath, _inputFileListPath);

            if (processState != NonInteractiveProcessState.Completed)
                return;

            var coverArt = releaseMedium != null ? releaseMedium.CoverArtImages.FirstOrDefault(image => image.IsSelected) : null;
            var coverArtImage = coverArt != null ? coverArt.Image : null;
            var mkvPropEdit = new MkvPropEdit(_jobObjectManager, _tempFileRegistrar) { SourceFilePath = outputMKVPath }
                .RemoveAllTags()
                .AddCoverArt(coverArtImage)
                .SetChapters(playlist.Chapters)
            //                .SetDefaultTracksAuto(selectedTracks) // Breaks MediaInfo
            ;
            mkvPropEdit.Start();
        }