Examples - Slugger/embysweeper GitHub Wiki
Examples
All of the examples run via docker. To run without docker, you need JRE8+ installed on your system then just replace docker run --rm slugger/embysweeper:...
with java -jar embysweeper.jar
, everything else will be the same.
The examples are using the latest version. For older versions, you will have to adapt the options as needed. Between major releases, the options are not the same! Always run in dry run mode before letting this tool loose on your media library!! You've been warned!!!
Delete anything watched more than 7 days ago by Kid1 that isn't in the Movies library, isn't a favourite itself and the series isn't a favourite
docker run --rm slugger/embysweeper:2.0.0 -s 192.168.1.2 -u admin -p password --ignore-fav-series --filter IsPlayed=true --filter IsFavorite=false -b Movies -e Kid1 delete
By default the delete command only prints, doesn't actually delete (dry run mode by default). To actually perform the delete, you must add the -d
option after the delete command in the above example.
Keep at most 5 airings of Jimmy Kimmel Live
docker run --rm slugger/embysweeper:2.1.0 -s 192.168.1.2 -u admin -p password -i TV --filter NameStartsWith="Jimmy Kimmel Live" --filter IsFolder=false -e Kid1 --min-age-days 0 keep -k 5
Keeps the 5 most recently added episodes of Jimmy Kimmel Live, deleting all other ones. When deleting, oldest items are deleted first until the keep
count (-k 5) is achieved. Setting the --min-age-days
will only delete items that are at least that many days old. This age filter is applied after
the keep count filter. So if you have 10 episodes and want to keep 5, the 5 oldest ones are selected for deletion but if none of them are older than
min days then nothing is deleted. In this example, I set age to zero days which means the five newest episodes are kept and everything else is always
deleted.
The keep command is new in version 2.1.0.
Ignore episodes if series is tagged
docker run --rm slugger/embysweeper:2.1.0 -s 192.168.1.2 -u admin -p password -i TV --ignore-series-tag MyTag --filter IsPlayed=true -e Kid1 delete
Delete all episodes in the TV library that have been watched at least 7 days ago. Do not delete episodes if their series has the MyTag tag applied to it.
The --ignore-series-tag option is new in version 2.1.0.
Only consider items in the TV library for deletion, ignore every other library
docker run --rm slugger/embysweeper:2.0.0 -s 192.168.1.2 -u admin -p password --ignore-fav-series --filter IsPlayed=true --filter IsFavorite=false -i TV -e Kid1 delete
You must include or exclude libraries
run --rm slugger/embysweeper:2.0.0 -s 192.168.1.2 -u admin -p password --ignore-fav-series --filter IsPlayed=true --filter IsFavorite=false delete
Error: Missing required argument (specify one of these): (-b=<excludedLibraries> [-b=<excludedLibraries>]... | -i=<includedLibraries> [-i=<includedLibraries>]...)
You must include or exclude libraries. Pro tip: To easily include every library, simply exclude one library that doesn't exist. Please be careful with this, there's a reason you're forced to include/exclude libraries explicitly -- safety first!
You can't include and exclude libraries at the same time
run --rm slugger/embysweeper:2.0.0 -s 192.168.1.2 -u admin -p password --ignore-fav-series --filter IsPlayed=true --filter IsFavorite=false -i TV -b Movies delete
Error: --excluded-library=<excludedLibraries>, --included-library=<includedLibraries> are mutually exclusive (specify only one)
You must include or exclude libraries, but you can't do both at the same time.
Verbose logging
docker run --rm slugger/embysweeper:2.0.0 -s 192.168.1.2 -u admin -p password --ignore-fav-series --filter IsPlayed=true --filter IsFavorite=false -i TV -e Kid1 -l debug delete
If you ask for help and are asked to capture more verbose logging of the app itself, then use the -l debug
option (or trace
).
Logging Emby API calls
docker run --rm slugger/embysweeper:2.0.0 -s 192.168.1.2 -u admin -p password --ignore-fav-series --filter IsPlayed=true --filter IsFavorite=false -i TV -e Kid1 -l debug --lib-log-level debug delete
If you're asked to capture the raw api calls, then use the --lib-log-level debug
option. Never go above debug
unless explicitly asked to do so. WARNING: When capturing the raw api calls, your id & password will be captured in the raw http output that is logged. Be careful of this if you post your logs to a public forum (i.e. the Emby forums).
Audit a file
docker run --rm slugger/embysweeper:2.0.0 -s 192.168.1.2 -u admin -p password --ignore-fav-series --filter IsPlayed=true --filter IsFavorite=false -i TV -e Kid1 audit -f /some/media/episode.mkv
The audit command will take the given file and apply all of your filters to it one by one until it determines which filter is preventing it from being deleted. Use this action to investigate a file when you think it should be deleted, but it isn't.