2.0.0 ā€¢ Published 3 years ago

media-organize v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

media-organize

GitHub Issues npm version dependencies devDependencies license

A CLI utility for organizing your media collections via symbolic links.

āœ… Auto-detect šŸ“ŗ Series, šŸ™ Anime and šŸŽ¬ Movies
āœ… No dependencies on external web services!
āœ… Extract Season/Episode Numbers
āœ… File Watcher šŸ‘€ links new files
āœ… Unlinks āŒ deleted files
āœ… Customizable Naming Format
āœ… Powerful Nunjucks Templating
āœ… Multiple Directory Support
āœ… Logging & File Rotation

This plugin will never move or delete your media files, because that's your (or your torrent client's) job!

Installation

Requirements:

  • NodeJS 12+

Install from NPM

npm i -g media-organize

Install from Source

git clone https://github.com/tgxn/media-organize
cd media-organize
npm install -g .

Usage

orgMedia

run media organization

Commands:
  orgMedia run    run media organization                               [default]
  orgMedia watch  start media watchers                              [aliases: w]

Options:
      --help     Show help                                             [boolean]
      --version  Show version number                                   [boolean]
  -d, --data     app data directory            [string] [default: "~/.orgMedia"]
  -l, --log      enable logging to data directory      [boolean] [default: true]
  -q, --quiet    hide console log output              [boolean] [default: false]

Automatic Methods

CRON (Regular Runs)
orgMedia

Watcher/Screen (creates a screen named media_watcher watching your media)
screen -S media_watcher -dm orgMedia watch

Configuration

Config file is config.json and has the following mandatory properties:

OptionPurposeExample
directoriesArray of directories to scan["../series"]
targetPathTarget directory for sorted files../sorted
targetFormatNaming format of the output linksSee below for details

And the following non-mandatory options:

OptionDefaultPurpose
enabledtrue
allowedExtensions*Array Extension to allow, (empty or omitted for all)
ignoredExtensionsNoneArray Extensions to ignore
linkSubtitlesfalseShould subtitle files be copied alongside media files?
subtitleExtensionsNoneExtensions to link with media
useHighestQualityfalseShould a higher-quality release replace a lower one?
strictTypeNoneWhether this config block should only accept movies or series
allowedSizeNoneArray Minimum and Maximum (if required) file sizes, in MB. [50, 5000]

You can also specify an array of config objects if you have different file types/directories to scan.

See config.example.json for further example configurations.

targetFormat usable variables

This is a list of the basic metadata that should be available on each media item.

VariableValueExample
{{name}}Series/Show/Movie NameName
{{season}}Season Integer10
{{episode}}Episode Integer34
{{year}}Year Integer2021
{{extension}}File Extension.mkv
{{classifier}}Meta The classifier used to detect the media type.

caseFormat filter

This filter will automatically use the Case library to format a string.

Usage:
{{ name | caseFormat('capital') }}

Example:
{{ 'foo_v_bar' | caseFormat('capital') }} -> 'Foo V Bar'

appendYear filter

This filter will automatically append the year (in brackets) at the end of the given string.

Note: Always use appendYear after caseFormat (or other filters that modify the title) so that you don't modify the year.

Usage:
{{ name | appendYear }}

Example:
{{ 'name' | appendYear }} -> 'name (2021)'

normal filter

This filter will automatically strip non-filename-safe characters.

Specifically: #%&{}/\<>^*?$!'":+|@=`