Add release-tag naming-scheme fields (resolution, source, codecs, group)
Match now also parses filename-only release-tag text - resolution, source
(BluRay/HDTV/WEB-DL/...), video/audio codec, and release group - via a new
guess_release_info() in renamr-core's matching module, wired through a new
guess_release_info Tauri command and called alongside the existing TV/movie
guess for every file. Naming schemes can now reference
{resolution}/{source}/{video codec}/{audio codec}/{release group}, or
FileBot's own short names ({vf}/{source}/{vc}/{ac}/{group}).
This commit is contained in:
+14
-1
@@ -4,7 +4,7 @@ mod metadata;
|
||||
mod settings;
|
||||
|
||||
use renamr_core::format::ExpressionFormat;
|
||||
use renamr_core::matching::{self, EpisodeGuess, MovieGuess};
|
||||
use renamr_core::matching::{self, EpisodeGuess, MovieGuess, ReleaseInfo};
|
||||
use renamr_core::rename::{self, RenameAction, RenamePlanItem, RenameResult};
|
||||
use renamr_core::string_bindings;
|
||||
use std::collections::HashMap;
|
||||
@@ -39,6 +39,18 @@ fn guess_movie(filename: String) -> Option<MovieGuess> {
|
||||
matching::guess_movie(&filename)
|
||||
}
|
||||
|
||||
/// Guesses release-tag metadata (resolution, source, video/audio codec, release
|
||||
/// group) from a filename's own text using local regex patterns only - no network
|
||||
/// calls, no real media probing (Renamr never ships an ffprobe/MediaInfo dependency,
|
||||
/// so filename tags are the only source for these fields). Independent of
|
||||
/// `guess_episode`/`guess_movie`: called alongside whichever of those two applies,
|
||||
/// since a release name carries (or doesn't carry) these tags regardless of whether
|
||||
/// it's an episode or a movie.
|
||||
#[tauri::command]
|
||||
fn guess_release_info(filename: String) -> Option<ReleaseInfo> {
|
||||
matching::guess_release_info(&filename)
|
||||
}
|
||||
|
||||
/// Executes a batch of planned on-disk rename/copy/symlink operations (optionally
|
||||
/// moving/copying files into subfolders - see `renamr_core::rename`; conflicting
|
||||
/// targets are always skipped, never overwritten). `action` picks which of the three
|
||||
@@ -67,6 +79,7 @@ pub fn run() {
|
||||
render_expression,
|
||||
guess_episode,
|
||||
guess_movie,
|
||||
guess_release_info,
|
||||
execute_rename,
|
||||
metadata::fetch_metadata,
|
||||
metadata::fetch_movie_metadata,
|
||||
|
||||
Reference in New Issue
Block a user