#media-server #rename #plex #batch #command-line-tool #directory-structure #cli

app rplexfmtr

A command line tool to batch rename media files for Plex® Media Server TV Show

3 stable releases

1.0.6 Jul 5, 2023
1.0.4 Jun 28, 2023

#1085 in Command line utilities

GPL-3.0-only

510KB
392 lines

rplexfmtr

Quick, easy to use, cross platform utility for batch renaming of video files for Plex® Media Server TV Shows.

rplexfmtr Demo

Usage

plexfmtr -i [input_folder(s)] -o [output_folder]

Where input_folders(s) is the folder containing the media to be renamed. You can input multiple media folders as a space separated list. The output folder is a single output directory where the the series will be moved to.

NOTE: The output directory will serve as the root of the output folder structure for the individual series entries. For example: if you input a show called Bob whose episodes belong to season 1 with the output directory being ~/Downloads. The episodes will be located in ~/Downloads/Bob/Season 1/.

Install

You can install rplexfmtr via cargo using the following command:

cargo install rplexfmtr

Or by going to our Github releases.

Step-by-step Example

Command Invocation Example

Here we give the folder(s) containing the files we want to rename using the -i flag and specify where we want to move the files using the -o flag.

After pressing enter, we are shown the first input directory given and rplexfmtr asks us what would you like the files in folder highlighted in green.

Name Prompt

After, we can input a name as we would be renaming a file. Entering A Name

After pressing enter once again, we will be shown a list of the files within the directory highlighted in green.

Display Directory Files
Once here we can choose which files we would like to rename. We can input a range in the prompt in the any of the following formats:

  • Dual ended range. For example, 0-2 will choose files 0,1,2.
  • Left ended range: For example, 1- will choose files 1,2,3, from the files presented above.
  • Right ended range: For example, -2 will choose files 0,1,2, from the files presented above.
  • Comma Separated Values: For example, 0,1,3 will chooses files 0,1,3.
  • Space separated values: For example, 2 1 3 will choose files 1,2,3.
  • Whole list: If you press enter without giving a range, all the files will be selected. For example, files 0,1,2,3 will be chosen, from the files presented above.

Entering a Range
NOTE: If a value provided by the user is not in the list, for example 4 in the above example, this number will be discarded.

After pressing enter, we are asked what season number do these files belong to. Entering a season

If there are more input directories given, we will be prompted give a name, chose the files and give a season for all input directories.

Once all input directories have been processed, we are prompted to preview the changes that we are going to make to the files. If we type y, a table is presented showing the changes that we inputted. Preview Changes

Finally, we are asked if we are happy with these changes and if we would like to execute these changes by typing y and then pressing enter.

Once the renaming process is complete, rplexfmtr will remind us where the files where all the folders are located.

Building from source

First clone the master branch of the github repo:

git clone "https://github.com/nikolaizombie1/rplexfmtr.git"

Then enter the rplexfmtr directory:

cd rxplexfmtr

Then, compile the binary:

cargo build --release

The standalone binary will be located in target/release/rplexfmtr

Viewing Documentation

To view the documentation for this binary crate you first need to download the git repository:

git clone "https://github.com/nikolaizombie1/rplexfmtr.git"

Then enter the rplexfmtr directory:

cd rxplexfmtr

Finally, view the documentation with:

cargo doc --open

Dependencies

~38–55MB
~1M SLoC