Typedef
Static Public Summary | ||
public |
addNewPath event |
|
public |
error_in_function event |
|
public |
missing_parameter event |
|
public |
removeOldFiles event |
|
public |
scan event |
|
public |
StorageVar: Set<TPN_Extended>|Map<string, Set<TPN_Extended> The sub way to store all kind of media files found in paths |
|
public |
The master variable where we store all kind of media files found in paths |
|
public |
The result of parsing file name |
|
public |
The extended TPN object |
|
public |
allows user to provide custom filtering stuff |
|
public |
customParsingFunction(title: string): TPN: Function A parsing function to be used with this lib |
|
public |
Number expression for number filtering |
|
public |
The search syntax for number properties : a operator follows by a number |
|
public |
search parameters object |
Static Public
public Events#addNewPath: Object source
addNewPath event
Properties:
Name | Type | Attribute | Description |
paths | ...string | all the paths that were added |
Example:
TorrentLibraryInstance.on('addNewPath',function(callback){
console.log('The following files were added : ' + callback.paths);
})
public Events#error_in_function: Object source
error_in_function event
Example:
TorrentLibraryInstance.on('error_in_function',function(callback){
console.log('Function ' + callback.functionName + ' has the following error : ' + callback.error);
})
public Events#missing_parameter: Object source
missing_parameter event
Properties:
Name | Type | Attribute | Description |
functionName | string | Indicates the function name when the error occurs. |
Example:
TorrentLibraryInstance.on('missing_parameter',function(callback){
console.log('Parameter is missing in ' + callback.functionName);
})
public Events#removeOldFiles: object source
removeOldFiles event
Properties:
Name | Type | Attribute | Description |
files | ...string | all the files that were found and removed if not yet in lib |
Example:
TorrentLibraryInstance.on('removeOldFiles',function(callback){
console.log('The following files were added : ' + callback.files);
})
public Events#scan: object source
scan event
Properties:
Name | Type | Attribute | Description |
files | ...string | all the files that were found and added if not yet in lib |
Example:
TorrentLibraryInstance.on('scan',function(callback){
console.log('The following files were found : ' + callback.files);
})
public StorageVar: Set<TPN_Extended>|Map<string, Set<TPN_Extended> source
The sub way to store all kind of media files found in paths
public StoreVar: Map<string, StorageVar> source
The master variable where we store all kind of media files found in paths
Example:
// An example of the variable after the scan method
[
"MOVIES" : [
{
"year": 2014,
"resolution": '1080p',
"source": 'brrip',
"codec": 'x264',
"container": 'mkv',
"title": 'Captain Russia The Summer Soldier',
"filePath": "D:\somePath\Captain Russia The Summer Soldier (2014) 1080p BrRip x264.MKV"
}
],
"TV_SERIES" : [
"The Blacklist" : [
{
"season": 4,
"episode": 21,
"source": "webrip",
"codec": "xvid",
"container": "avi",
"language": "french"
"filePath" : "D:\somePath\The.Blacklist.S04E21.FRENCH.WEBRip.XviD.avi"
}
]
]
]
public TPN: Object source
The result of parsing file name
Properties:
Name | Type | Attribute | Description |
title | string | The file title |
|
season | number |
|
The season number |
episode | number |
|
The episode number |
year | number |
|
The year |
resolution | string |
|
The resolution |
codec | string |
|
The codec |
audio | string |
|
The audio |
group | string |
|
The group that releases this file |
region | string |
|
The region |
container | string |
|
The container |
language | string |
|
The file language |
extended | boolean |
|
extended ? |
unrated | boolean |
|
unrated ? |
proper | boolean |
|
proper ? |
repack | boolean |
|
repack ? |
convert | boolean |
|
convert ? |
hardcoded | boolean |
|
hardcoded ? |
retail | boolean |
|
retail ? |
remastered | boolean |
|
remastered ? |
source | string |
|
the source |
Example:
{
"container":"avi",
"source":"webrip",
"codec":"xvid",
"season":4,
"episode":14,
"language":"french",
"title":"The Blacklist"
}
See:
- https://github.com/clement-escolano/parse-torrent-title
public TPN_Extended: TPN source
The extended TPN object
Properties:
Name | Type | Attribute | Description |
filePath | string | additionnal property useful for this library |
Example:
{
"container":"avi",
"source":"webrip",
"codec":"xvid",
"season":4,
"episode":14,
"language":"french",
"title":"The Blacklist",
"filePath":"D:\\workspaceNodeJs\\torrent-files-library\\test\\folder2\\The.Blacklist.S04E14.FRENCH.WEBRip.XviD.avi"
}
public additionalProperties: Object source
allows user to provide custom filtering stuff
Example:
{ type: 'number', name: 'AnotherField2', value: '<=25' }
{ type: 'boolean', name: 'AnotherField', value: true }
{ type: 'number', name: 'AnotherField2', value: 25 }
{ type: 'string', name: 'AnotherField', value: ['NothingExists', 'NothingExists'] }
public customParsingFunction(title: string): TPN: Function source
A parsing function to be used with this lib
Example:
// default parser used in this lib
const parser = require("parse-torrent-title").parser;
// extended default parser as explained here : https://github.com/clement-escolano/parse-torrent-title#advanced-usage
const ptt = require("parse-torrent-title");
ptt.addHandler("part", /Part[. ]([0-9])/i, { type: "integer" });
const parser = ptt.parse;
// original parser used in this lib : https://github.com/jy95/torrent-name-parser
const parser = require('torrent-name-parser');
public numberExpressionObject: Object source
Number expression for number filtering
Example:
{ operator: '>=' , number: 5 }
public numberSearchSyntax: string source
The search syntax for number properties : a operator follows by a number
Example:
'<=25'
'=25'
public searchParameters: Object source
search parameters object
Properties:
Name | Type | Attribute | Description |
extended | boolean |
|
extended ? |
unrated | boolean |
|
unrated ? |
proper | boolean |
|
proper ? |
repack | boolean |
|
repack ? |
convert | boolean |
|
convert ? |
hardcoded | boolean |
|
hardcoded ? |
retail | boolean |
|
retail ? |
remastered | boolean |
|
remastered ? |
season | number | numberSearchSyntax |
|
the season |
episode | number | numberSearchSyntax |
|
the episode |
year | number | numberSearchSyntax |
|
the year |
title | string | string[] |
|
the title |
resolution | string | string[] |
|
the resolution |
codec | string | string[] |
|
the codec |
audio | string | string[] |
|
the audio |
group | string | string[] |
|
the group |
region | string | string[] |
|
the region |
container | string | string[] |
|
the container |
language | string | string[] |
|
the language |
source | string | string[] |
|
the source |
additionalProperties | additionalProperties[] |
|
additional Properties |