Giter VIP home page Giter VIP logo

repisode's Introduction

Repisode

Repisode is a yet another episode number fixer.

It pads episode numbers (or any number!) with a 0 where required, making your files sort properly.

Example Scenario

Lets say you have these files:

  • Rick and Morty S1E1.mp4
  • Rick and Morty S1E10.mp4
  • Rick and Morty S1E11.mp4
  • Rick and Morty S1E12.mp4
  • Rick and Morty S1E2.mp4
  • Rick and Morty S1E3.mp4
  • Rick and Morty S1E4.mp4
  • Rick and Morty S1E5.mp4
  • Rick and Morty S1E6.mp4
  • Rick and Morty S1E7.mp4
  • Rick and Morty S1E8.mp4
  • Rick and Morty S1E9.mp4

The files are sorted alphabetically, but the alphabetical order does not reflect the episode order! If you wanted to use ffmpeg, you probably would like to fix your file names first!

Here's where repisode comes in handy. In a single command your files will be properly ordered:

repisode 'Rick and Morty S1E@[email protected]' *.mp4

The @N@ is required to specify the number that needs fixing, this is for a finer control.

Observe the output of ls -1 after running the above:

Rick and Morty S1E01.mp4
Rick and Morty S1E02.mp4
Rick and Morty S1E03.mp4
Rick and Morty S1E04.mp4
Rick and Morty S1E05.mp4
Rick and Morty S1E06.mp4
Rick and Morty S1E07.mp4
Rick and Morty S1E08.mp4
Rick and Morty S1E09.mp4
Rick and Morty S1E10.mp4
Rick and Morty S1E11.mp4
Rick and Morty S1E12.mp4

Wham, ready for concatenation.

Installation

Repisode is written in rust and tested with cargo version 1.55.0. You will need git and an up to date rust toolchain installed.

The preferred way of installation is by git clone:

git clone https://github.com/insomnimus/repisode
cd repisode
git checkout main
# to run tests; do:
# cargo test
cargo install --path .

The other method is using cargo directly:

cargo install --git https://github.com/insomnimus/repisode --branch main

Have fun, don't forget to check for updates!

Pattern Syntax

The <pattern> is a specialized glob pattern:

  • The * wildcard matches anything 0 or more times.
  • The ? wild card matches one or zero unicode code point (character).
  • The @N@ matches any digit at least once. This is how you mark a number to be fixed.
  • The * and ? wildcards can be escaped with a \.
  • Any space character (ie , \t) is turned into \s in regex.
  • No other symbol/character has any special meaning, they are matched literally.
  • The pattern matching is case insensitive (full unicode support in case-folding).

Note For Windows Users

Assuming you use powershell or cmd.exe, the shell does not expand glob patterns by itself. That's why repisode will interpret any glob patterns for you.

repisode's People

Contributors

insomnimus avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.