Skip to content

A program for renaming media, specially for following conventions of media servers like Plex, Jellyfin, etc...

Notifications You must be signed in to change notification settings

arch-fan/rnmedia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rnmedia

A simple tool to rename, copy, or link media files to follow naming conventions.

Features

  • 📝 Rename files in place
  • 📋 Copy files to a destination directory
  • 🔗 Hard link files for space efficiency
  • 🔗 Symbolic link files for flexible references
  • 👁️ Dry run mode to preview changes before applying
  • 🎯 Episode offset support for continuing seasons
  • Comprehensive test coverage with 24+ tests

Installation

Download the binary from the releases page and add it to your PATH.

Or use cargo to install it:

cargo install --git https://github.com/arch-fan/rnmedia

Or with Nix:

nix run github:arch-fan/rnmedia

Usage

Basic Renaming

Rename files in the same directory:

rnmedia --media "The Office" --season 1 season_path/

The output will be something like:

[random_rip] The Office - Chapter 1.mkv -> The Office - S01E01.mkv (rename)
[random_rip] The Office - Chapter 2.mkv -> The Office - S01E02.mkv (rename)
[random_rip] The Office - Chapter 3.mkv -> The Office - S01E03.mkv (rename)
[random_rip] The Office - Chapter 4.mkv -> The Office - S01E04.mkv (rename)
[random_rip] The Office - Chapter 5.mkv -> The Office - S01E05.mkv (rename)
[random_rip] The Office - Chapter 6.mkv -> The Office - S01E06.mkv (rename)

If you want the files to be renamed, use the flag --apply:

rnmedia --apply --media "The Office" --season 1 season_path/

Copy to Destination

Copy files to a different directory with new names:

rnmedia --media "Breaking Bad" --season 2 --destination /media/shows/ source_path/

Hard Links

Create hard links instead of copying (saves disk space):

rnmedia --hardlink --media "Game of Thrones" --season 3 --destination /backup/ source_path/

Symbolic Links

Create symbolic links for flexible file references:

rnmedia --symlink --media "Stranger Things" --season 1 --destination /linked/ source_path/

Episode Offset

Start numbering from a specific episode (useful for split seasons):

rnmedia --media "Attack on Titan" --season 3 --offset 12 season_path/
# Results in S03E13, S03E14, S03E15...

Help command

$ rnmedia --help
Usage: rnmedia [OPTIONS] --season <SEASON> --media <MEDIA> <PATH>

Arguments:
  <PATH>  Path to the directory containing media files

Options:
  -a, --apply                      Actually apply the new filenames (if not provided, just prints preview)
  -s, --season <SEASON>            Season number
  -m, --media <MEDIA>              Media title
  -o, --offset <OFFSET>            Episode offset [default: 0]
  -l, --hardlink                   Create hard links instead of renaming/copying files
  -L, --symlink                    Create symbolic links instead of renaming/copying files
  -d, --destination <DESTINATION>  Destination directory (for copy, hard link, or symbolic link operations)
  -h, --help                       Print help
  -V, --version                    Print version

Development

Running Tests

cargo test

Formatting and Linting

cargo fmt
cargo clippy -- -D warnings

Building with Nix

nix build
./result/bin/rnmedia --help

About

A program for renaming media, specially for following conventions of media servers like Plex, Jellyfin, etc...

Topics

Resources

Stars

Watchers

Forks