2019-08-17 12:50:46 -07:00
|
|
|
mediasort
|
|
|
|
=========
|
|
|
|
|
|
|
|
Webapp for quick or automatic media sorting and integration with the Deluge torrent client.
|
|
|
|
|
|
|
|
|
|
|
|
configuration
|
|
|
|
-------------
|
|
|
|
|
2019-08-17 17:57:02 -07:00
|
|
|
Using a configuration file is recommended due to the complexity of the information needed. An example config is shown
|
|
|
|
and explained below:
|
2019-08-17 12:50:46 -07:00
|
|
|
|
2019-08-17 17:57:02 -07:00
|
|
|
```
|
|
|
|
{
|
|
|
|
"port": 8081,
|
|
|
|
"debug": true,
|
|
|
|
"library_path": "/media/raid/Media/TV/HD/",
|
|
|
|
"label": "sickrage",
|
|
|
|
"label_done": "sorted",
|
|
|
|
"stashprefix": "Sorted",
|
|
|
|
"deluges": [
|
|
|
|
{
|
|
|
|
"name": "T2",
|
|
|
|
"uri": "deluge://user:pass@localhost:58846",
|
|
|
|
"pathmap": ["/media/storage", "/media/raid/Torrents/Torrent1"]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "T5",
|
|
|
|
"uri": "deluge://user:pass@otherhost.com:58846",
|
|
|
|
"pathmap": ["/media/storage", "/media/raid/Torrents/Torrent2"]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"trackermap": {
|
|
|
|
"empirehost.me": "ipt"
|
|
|
|
},
|
|
|
|
"movedests": [
|
|
|
|
"Complete",
|
|
|
|
"SBComplete",
|
|
|
|
"Sorted/ipt"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Basic options
|
|
|
|
|
|
|
|
|key|meaning|example|
|
2019-08-17 12:50:46 -07:00
|
|
|
|---|---|---|
|
2019-08-17 18:30:30 -07:00
|
|
|
|port|http port to listen on|`8081`|
|
|
|
|
|debug|run the server in debug mode|`true`|
|
|
|
|
|library_path|file path to tv media library|`/data/library`|
|
|
|
|
|label|deluge label to look for sortable torrents under|`"sickrage"`|
|
|
|
|
|label_done|deluge label to mark sortable torrents as|`"sorted"`|
|
|
|
|
|stashprefix|when stashing torrents, prefix for the stash path|`"Sorted"`|
|
2019-08-17 17:57:02 -07:00
|
|
|
|
|
|
|
Beyond these options, mediasort has several more options to tune how it sorts your media that require more explanation.
|
2019-08-17 12:50:46 -07:00
|
|
|
|
2019-08-17 17:57:02 -07:00
|
|
|
Details about client instances are list under the `deluges` key. Each client requires a deluge connection string (a uri
|
|
|
|
starting with deluge://) and a pathmap. The pathmap is explained later.
|
2019-08-17 12:50:46 -07:00
|
|
|
|
2019-08-17 17:57:02 -07:00
|
|
|
Next, `library_path` should be set to your media library's path. The media library must contain top level directories
|
|
|
|
for each show, matchingly named. The name of the directory will be used to determine what show to put in it. In each
|
|
|
|
show directory, there should be one directory per season (such as "Season 6" or "2019") within which the actual media
|
|
|
|
files are placed.
|
2019-08-17 12:50:46 -07:00
|
|
|
|
2019-08-17 17:57:02 -07:00
|
|
|
Per client, `pathmap` must be set to translate paths when sorting files. This would be needed if your torrent client
|
|
|
|
has a different view of the filesystem than `mediasort` does, e.g. if they're running in docker containers. Consider
|
|
|
|
these two paths:
|
2019-08-17 12:50:46 -07:00
|
|
|
|
|
|
|
* `/media/storage/mylibrary/myshow/Season 5/episode.mkv`
|
|
|
|
* `/data/torrents/Complete/myshow.mkv`
|
|
|
|
|
|
|
|
The first is the destination path in your media library as seen by mediasort. The second is the path Deluge sees.
|
2019-08-17 17:57:02 -07:00
|
|
|
Setting `pathmap` to `/data/torrents/:/media/storage/torrents/` gives mediasort the info it needs to resolve these
|
|
|
|
paths - it translates the Deluge path by simply replacing the prefix obtained from the left half of the `pathmap` with
|
2019-08-17 12:50:46 -07:00
|
|
|
the right.
|
|
|
|
|
2019-08-17 17:57:02 -07:00
|
|
|
Finally, `movedests` provides a list of pre-filled destinations that Deluge may move files to after they're sorted.
|
|
|
|
These paths are appended to the left side of the pathmap.
|
2019-08-17 12:50:46 -07:00
|
|
|
|
2019-08-17 17:57:02 -07:00
|
|
|
After a torrent is sorted into your library, the torrent will "stashed", that is, moved to a directory other than your
|
|
|
|
default download location as well as labeled as such. Within the stash directory, the torrents are placed in another
|
|
|
|
subdirectory matching the hostname of the torrent's tracker. Optionally, these names can be translated to another name
|
|
|
|
with the values specified in `trackermap`. For example, having the `trackermap` entry `"foo.com": "foo",` would cause
|
|
|
|
the "foo.com" tracker directory to be named "foo" instead.
|
2019-08-17 14:28:25 -07:00
|
|
|
|
2019-08-17 12:50:46 -07:00
|
|
|
|
|
|
|
todo
|
|
|
|
----
|
2019-08-17 17:57:02 -07:00
|
|
|
* support full configuration through cli flags again
|
|
|
|
* support env vars in addition to command line flags for full configuration
|
2019-08-17 12:50:46 -07:00
|
|
|
* support re-labeling sorted torrents
|
2019-08-17 14:28:25 -07:00
|
|
|
* more options than just hard linking (soft link, copy)
|
|
|
|
* support sorting season torrents
|
2019-08-17 15:09:32 -07:00
|
|
|
* make UI pretty
|
2019-08-19 09:32:32 -07:00
|
|
|
* support post-sort webhooks e.g. to tell plex to rescan when we add something - maybe push and email too
|