Esempio n. 1
0
        public void RetagAuthor(RetagAuthorCommand message)
        {
            _logger.Debug("Re-tagging all audio files for selected authors");
            var authorToRename = _authorService.GetAuthors(message.AuthorIds);

            foreach (var author in authorToRename)
            {
                var bookFiles  = _mediaFileService.GetFilesByAuthor(author.Id);
                var audioFiles = bookFiles.Where(x => MediaFileExtensions.AudioExtensions.Contains(Path.GetExtension(x.Path))).ToList();

                _logger.ProgressInfo("Re-tagging all audio files for author: {0}", author.Name);
                foreach (var file in audioFiles)
                {
                    WriteTags(file, false, force: true);
                }

                _logger.ProgressInfo("All audio files re-tagged for {0}", author.Name);
            }
        }
Esempio n. 2
0
        public void RetagAuthor(RetagAuthorCommand message)
        {
            _logger.Debug("Re-tagging all ebook files for selected authors");
            var authorsToRename = _authorService.GetAuthors(message.AuthorIds);

            foreach (var author in authorsToRename)
            {
                var files = _mediaFileService.GetFilesByAuthor(author.Id);

                _logger.ProgressInfo("Re-tagging all ebook files for author: {0}", author.Name);

                foreach (var file in files.Where(x => x.CalibreId != 0))
                {
                    WriteTagsInternal(file, message.UpdateCovers, message.EmbedMetadata);
                }

                _logger.ProgressInfo("All ebook files re-tagged for {0}", author.Name);
            }
        }
Esempio n. 3
0
        public void Execute(RetagAuthorCommand message)
        {
            _logger.Debug("Re-tagging all files for selected authors");
            var authorsToRename = _authorService.GetAuthors(message.AuthorIds);

            foreach (var author in authorsToRename)
            {
                var files = _mediaFileService.GetFilesByAuthor(author.Id);

                _logger.ProgressInfo("Re-tagging all files for author: {0}", author.Name);

                foreach (var file in files.Where(x => x.CalibreId != 0))
                {
                    var rootFolder = _rootFolderService.GetBestRootFolder(file.Path);
                    _calibre.SetFields(file, rootFolder.CalibreSettings, message.UpdateCovers, message.EmbedMetadata);
                }

                _logger.ProgressInfo("All files re-tagged for {0}", author.Name);
            }
        }
Esempio n. 4
0
 public void Execute(RetagAuthorCommand message)
 {
     _eBookTagService.RetagAuthor(message);
     _audioTagService.RetagAuthor(message);
 }