1.3.0 • Published 4 years ago

medoc v1.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

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().
1.3.0

4 years ago

1.2.13

4 years ago

1.2.14

4 years ago

1.2.15

4 years ago

1.2.12

4 years ago

1.2.11

4 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago