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

medoc

v1.3.0

Published

A JavaScript library that can simply detect, clean up and transfert tv show episodes from a/ to b/.

Downloads

69

Readme

medoc

A JavaScript library that can simply detect, clean up and transfert tv show episodes from a/ to b/.

You can automatically download subtitles with Yquem.

License: MIT npm version Install size

Features

  • Detect tv show episodes from a source directory, ie: Final.Space.(2019).S01E01.mkv;
  • Move episodes to a destination directory with some changes, ie: Final Space/Season 1/Final Space - 1x01.mkv.

Install

$ npm install medoc

Usage

const Medoc = require('medoc')

const PATH_TO_SCAN = `w:`
const PATH_TO_PUSH = `z:`

const medoc = new Medoc(PATH_TO_SCAN, PATH_TO_PUSH)

medoc
  .run()
  .then(results => {
    console.log(results)
  })
  .catch(err => {
    console.error(err)
  })

Documentation

Instance methods

run()

Detect tv show files from a specified directory, clean the filename, and transfert the file to a specified directory.

Static methods

search([from], [to])

Search video files from a specified directory, get information from theirs filenames and return a list of episode.

  • from <string> Path to scan for video files.
  • to <string> Path where the video files will be transfered.

move([episode])

  • episode <object> Object build from the filename of the file.

Transfert a video file.

createDirectory([path])

Create directory and subdirectories if necessary.

  • path <string> Directory to create.

removePath([path])

Destroy directory or file.

  • path <string> Directory or file to destroy.

isEpisode([filename])

Check if a filename is well formated, format : /([sS]\d{2}[eE]\d{2})/.

  • filename <string> Filename, ie: S01E01.

hasFile([path])

Check if a directory contains video files.

  • path <string> Directory to check.

getYear([filename])

Extract release year from the filename, format : /([sS]\d{2}[eE]\d{2})/.

  • filename <string> Filename, ie: Final.Space(2019).S01E01.

getShowName([filename])

Extract show name from the filename.

  • filename <string> Filename.

getEpisodeSeason([filename])

Extract season number from the filename.

  • filename <string> Filename.

getEpisodeNumber([filename])

Extract episode number from the filename.

  • filename <string> Filename.

getFile([path])

Return the path of a video file.

  • filename <string> Filename.

getOriginDirectory([episode])

Return the origin directory for an episode.

  • episode <object> Object return by search().

getOriginPath([episode])

Return the complete origin path for an episode.

  • episode <object> Object return by search().

getDestinationDirectory([episode])

Return the destination directory for an episode.

  • episode <object> Object return by search().

getDestinationPath([episode])

Return the complete destination path for an episode.

  • episode <object> Object return by search().