{"id":13961823,"url":"https://github.com/jy95/mediaScan","last_synced_at":"2025-07-21T06:31:57.015Z","repository":{"id":29344440,"uuid":"121419580","full_name":"jy95/mediaScan","owner":"jy95","description":"A scanner for media files that follows a user-provided naming convention","archived":false,"fork":false,"pushed_at":"2024-06-11T16:31:00.000Z","size":2534,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T01:37:17.764Z","etag":null,"topics":["files","filesystem","filesystem-library","media","media-library","media-parsing","naming-conventions","npm-package","parser","scanner","scanning","torrent","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/jy95/torrent-files-library","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jy95.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://www.buymeacoffee.com/GPFR"]}},"created_at":"2018-02-13T18:27:40.000Z","updated_at":"2024-06-11T16:30:56.000Z","dependencies_parsed_at":"2024-01-17T16:08:36.472Z","dependency_job_id":"0e11a047-e832-4eb9-bc0e-ce87851f6985","html_url":"https://github.com/jy95/mediaScan","commit_stats":{"total_commits":172,"total_committers":8,"mean_commits":21.5,"dds":0.5930232558139534,"last_synced_commit":"a03784dee6017bd03edbc29cfeccb048fd635727"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/jy95/mediaScan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jy95%2FmediaScan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jy95%2FmediaScan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jy95%2FmediaScan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jy95%2FmediaScan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jy95","download_url":"https://codeload.github.com/jy95/mediaScan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jy95%2FmediaScan/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266253586,"owners_count":23900052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["files","filesystem","filesystem-library","media","media-library","media-parsing","naming-conventions","npm-package","parser","scanner","scanning","torrent","typescript"],"created_at":"2024-08-08T17:01:30.282Z","updated_at":"2025-07-21T06:31:52.002Z","avatar_url":"https://github.com/jy95.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/GPFR"],"categories":["TypeScript"],"sub_categories":[],"readme":"# mediascan [![Build Status](https://img.shields.io/travis/jy95/mediaScan.svg)](https://travis-ci.org/jy95/mediaScan)  [![codecov](https://codecov.io/gh/jy95/mediaScan/branch/master/graph/badge.svg)](https://codecov.io/gh/jy95/mediaScan) [![Dependency Status](https://img.shields.io/david/jy95/mediaScan.svg)](https://david-dm.org/jy95/mediaScan)   [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)  [![Greenkeeper badge](https://badges.greenkeeper.io/jy95/mediaScan.svg)](https://greenkeeper.io/)  [![Join the chat at https://gitter.im/mediaScan/Lobby](https://badges.gitter.im/mediaScan/Lobby.svg)](https://gitter.im/mediaScan/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\u003e A scanner for media files that follows a user-provided naming convention\n\n## What to do with this library ?\n\nA lot of things :\n* Basic listing purposes :\n    * [List found movies](https://github.com/jy95/mediaScan/wiki/List-found-movies)\n    * [List each found tv serie](https://github.com/jy95/mediaScan/wiki/List-each-found-tv-serie)\n    * [Detect the category of each file](https://github.com/jy95/mediaScan/wiki/Detect-the-category-of-each-file)\n* Filtering purposes :\n    * [Filter movies based on search parameters](https://github.com/jy95/mediaScan/wiki/Filter-movies-by-parameters)\n    * [Filter tv-shown based on search parameters](https://github.com/jy95/mediaScan/wiki/Filter-tv-series-by-parameters)\n* Miscellaneous purposes\n    * [Create custom playlist(s)](https://github.com/jy95/mediaScan/wiki/Create-custom-playlist(s))\n* ...\n\nDon't hesitate to suggest new features : it is always worthy :)\n\n## FAQ\n\n### Which naming convention can I use with this lib ?\n\n**ANYTHING**. All You have to do is to implement a parser function :\nA function that takes a single string argument `fullPathFile` (the full path to the file) that returns an object that minimal contains a `title` string property.\nFor example :\n\n```js\nconst ptt = require(\"parse-torrent-title\");\nconst information = ptt.parse(\"Game.of.Thrones.S01E01.720p.HDTV.x264-CTU\");\n\nconsole.log(information.title);      // Game of Thrones\nconsole.log(information.season);     // 1\nconsole.log(information.episode);    // 1\nconsole.log(information.resolution); // 720p\nconsole.log(information.codec);      // x264\nconsole.log(information.source);     // HDTV\nconsole.log(information.group);      // CTU\n```\n\nThis lib was tested with these parsers that follows torrent naming conventions (see their readme for more info) :\n\n* [parse-torrent-title](https://www.npmjs.com/package/parse-torrent-title) (the default in this lib)\n* [torrent-name-parser](https://www.npmjs.com/package/torrent-name-parser)\n* [torrent-name-parse](https://www.npmjs.com/package/torrent-name-parse)\n\n### How the library detects the category of a media file ?\n\nThe default implementation determines it is a tv-show if there is `season` and `episode` attributes can be found in the information provided by the parser.\nHere is a example if you want to implement one :\n```ts\n// Default implementation to know which category is this file\nfunction defaultWhichCategoryFunction(object : MediaScanLib.TPN) : MediaScanLib.Category{\n    // workaround : const string enum aren't compiled correctly with Babel\n    return (checkProperties(object, ['season', 'episode']))\n        ? 'TV_SERIES' as MediaScanLib.Category.TV_SERIES_TYPE : 'MOVIES' as MediaScanLib.Category.MOVIES_TYPE;\n}\n```\n\n### Using custom parameters in the lib\n\nCheck the [constructor](https://github.com/jy95/mediaScan/blob/master/src/MediaScan.ts#L38) for more detail - an illustration :\n\n```js\nconst MediaScan = require(\"mediascan\");\nlet libInstance = new MediaScan({\n    defaultPath = process.cwd(), // Default path to explore , if paths is empty\n    paths = [], // all the paths that will be explored\n    allFilesWithCategory = new Map(), // the mapping between file and Category\n    movies = new Set(), // Set\u003cParserResult\u003e (all the movies)\n    series = new Map(), // \u003ctvShowName , Set\u003cParserResult\u003e\u003e (all the tv-series episodes)\n}, {\n    parser = nameParser, // the explained parser\n    whichCategory = defaultWhichCategoryFunction, // the previously explained detection function\n});\n```\n\n## Installation\n\nFor npm users :\n\n```shell\n$ npm install --save mediascan\n```\n\nfor Yarn :\n```shell\n$ yarn add mediascan\n```\n\n## Test\n\n```shell\nnpm test\n```\n\n# Types definitions\n\nIf You want, You can have the types definitions used in this lib :\n\n```shell\nnpm install @types/mediascan\n```\n\n## Contributing\n\n* If you're unsure if a feature would make a good addition, you can always [create an issue](https://github.com/jy95/mediaScan/issues/new) first.\n* We aim for 100% test coverage. Please write tests for any new functionality or changes.\n* Any API changes should be fully documented.\n* Make sure your code meets our linting standards. Run `npm run lint` to check your code.\n* Be mindful of others when making suggestions and/or code reviewing.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjy95%2FmediaScan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjy95%2FmediaScan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjy95%2FmediaScan/lists"}