From 0c6cc4acdb2d1e157aeea54dd794f1c43f48ce85 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sat, 20 Apr 2019 22:10:03 -0400 Subject: [PATCH] New: AudioBitRate Naming Token --- frontend/src/Settings/MediaManagement/Naming/NamingModal.js | 5 +++-- src/NzbDrone.Core/Organizer/FileNameBuilder.cs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/Settings/MediaManagement/Naming/NamingModal.js b/frontend/src/Settings/MediaManagement/Naming/NamingModal.js index 3438e4603..f96d364e6 100644 --- a/frontend/src/Settings/MediaManagement/Naming/NamingModal.js +++ b/frontend/src/Settings/MediaManagement/Naming/NamingModal.js @@ -90,6 +90,7 @@ const qualityTokens = [ const mediaInfoTokens = [ { token: '{MediaInfo AudioCodec}', example: 'FLAC' }, { token: '{MediaInfo AudioChannels}', example: '2.0' }, + { token: '{MediaInfo AudioBitRate}', example: '320kbps' }, { token: '{MediaInfo AudioBitsPerSample}', example: '24bit' }, { token: '{MediaInfo AudioSampleRate}', example: '44.1kHz' } ]; @@ -100,8 +101,8 @@ const otherTokens = [ ]; const originalTokens = [ - { token: '{Original Title}', example: 'Artist.Name.S01E01.HDTV.x264-EVOLVE' }, - { token: '{Original Filename}', example: 'artist.name.s01e01.hdtv.x264-EVOLVE' } + { token: '{Original Title}', example: 'Artist.Name.Album.Name.2018.FLAC-EVOLVE' }, + { token: '{Original Filename}', example: '01 - track name' } ]; class NamingModal extends Component { diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index 006cff7ca..f5b27ff4a 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -341,6 +341,7 @@ namespace NzbDrone.Core.Organizer tokenHandlers["{MediaInfo AudioCodec}"] = m => audioCodec; tokenHandlers["{MediaInfo AudioChannels}"] = m => audioChannelsFormatted; + tokenHandlers["{MediaInfo AudioBitRate}"] = m => MediaInfoFormatter.FormatAudioBitrate(trackFile.MediaInfo); tokenHandlers["{MediaInfo AudioBitsPerSample}"] = m => MediaInfoFormatter.FormatAudioBitsPerSample(trackFile.MediaInfo); tokenHandlers["{MediaInfo AudioSampleRate}"] = m => MediaInfoFormatter.FormatAudioSampleRate(trackFile.MediaInfo); }