npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

media-organize

v2.0.0

Published

[![GitHub Issues](https://img.shields.io/github/issues/tgxn/media-organize.svg)](https://github.com/tgxn/media-organize/issues) [![npm version](https://img.shields.io/npm/v/media-organize.svg)](https://www.npmjs.com/package/media-organize) [![dependencies

Downloads

17

Readme

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:

| Option | Purpose | Example | | -------------- | --------------------------------- | --------------------- | | directories | Array of directories to scan | ["../series"] | | targetPath | Target directory for sorted files | ../sorted | | targetFormat | Naming format of the output links | See below for details |

And the following non-mandatory options:

| Option | Default | Purpose | | -------------------- | ------- | ------------------------------------------------------------------------- | | enabled | true | | | allowedExtensions | * | Array Extension to allow, (empty or omitted for all) | | ignoredExtensions | None | Array Extensions to ignore | | linkSubtitles | false | Should subtitle files be copied alongside media files? | | subtitleExtensions | None | Extensions to link with media | | useHighestQuality | false | Should a higher-quality release replace a lower one? | | strictType | None | Whether this config block should only accept movies or series | | allowedSize | None | Array 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.

| Variable | Value | Example | | ---------------- | ---------------------------------------------------- | ------- | | {{name}} | Series/Show/Movie Name | Name | | {{season}} | Season Integer | 10 | | {{episode}} | Episode Integer | 34 | | {{year}} | Year Integer | 2021 | | {{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: ``#%&{}/<>^*?$!'":+|@=`