Clean function not removing empty folders
Posted: 13 Oct 2025, 21:23
For some time now the clean=y function has not been working for me. I believe this started when I had to update my script to use the ut_dir parameter.
The log file doesn't show the empty folders that it used to delete. One of the folders does have a hidden file that is 1MB, though I'm sure it used to delete these as well.
Log file
The log file doesn't show the empty folders that it used to delete. One of the folders does have a hidden file that is 1MB, though I'm sure it used to delete these as well.
Groovy: Select all
-script
fn:amc
-non-strict
--output
N:/
--action
move
--conflict
skip
--log-file
N:/Media/#Unprocessed/AMC/amc.log
--def
clean=y
minLengthMS=0
ignore=AMC|Extracted|Placeholder
pushover=******
seriesDB=TheMovieDB::TV
movieFormat=N:/Media/Movies/{ any{ certification ==~ /G|PG/ ? 'Family' : 'Adults' }{ 'Adults' } }/{ ~plex ** { ' ' + [vf] + [certification] } }{ [group] }
seriesFormat=N:/Media/TV Shows/{ any{ certification ==~ /G|TV-G|TV-Y|TV-Y7/ ? 'Kids TV' : 'Adults' }{ 'Adults'} }/{plex.tail}
excludeList=N:/Media/#Unprocessed/AMC/amcexclude.txt
ut_dir=N:/Media/#UnprocessedConsole Output: Select all
Run script [fn:amc] at [Mon Oct 13 00:00:03 MDT 2025]
Parameter: clean = y
Parameter: minLengthMS = 0
Parameter: ignore = AMC|Extracted|Placeholder
Parameter: pushover = *****
Parameter: seriesDB = TheMovieDB::TV
Parameter: movieFormat = N:/Media/Movies/{ any{ certification ==~ /G|PG/ ? 'Family' : 'Adults' }{ 'Adults' } }/{ ~plex ** { ' ' + [vf] + [certification] } }{ [group] }
Parameter: seriesFormat = N:/Media/TV Shows/{ any{ certification ==~ /G|TV-G|TV-Y|TV-Y7/ ? 'Kids TV' : 'Adults' }{ 'Adults'} }/{plex.tail}
Parameter: excludeList = N:/Media/#Unprocessed/AMC/amcexclude.txt
Parameter: ut_dir = N:/Media/#Unprocessed
Invalid usage: input folder [N:/Media/#Unprocessed] must not start with output folder [N:\]
Invalid usage: --def ut_dir and --def ut_kind must be specified in tandem
Use excludes: N:\Media\#Unprocessed\AMC\amcexclude.txt (4)
Ignore hidden: N:\Media\#Unprocessed\.sync
Ignore pattern: N:\Media\#Unprocessed\AMC
Ignore pattern: N:\Media\#Unprocessed\Duplicate Show Override - AMC.ps1
Ignore pattern: N:\Media\#Unprocessed\Extracted
Ignore pattern: N:\Media\#Unprocessed\Placeholder.txt
Input: N:\Media\#Unprocessed\60.Minutes.S58E03.1080p.WEB.h264-BAE.mkv
Group files by movie or series
Group: {Series=60 Minutes (1968)} => [60.Minutes.S58E03.1080p.WEB.h264-BAE.mkv]
Rename episodes using [TheMovieDB] with [Airdate Order]
Lookup via [60 Minutes] [60 Minutes]
Fetching episode data for [60 Minutes]
* 60 Minutes [651] | 978 episodes | 1x01-06 .. 2x01 .. 3x01 .. 4x01 .. 5x01 .. 6x01 .. 7x33 .. 16x04 .. 22x27 .. 24x32x52 .. 25x43 .. 26x44 .. 27x42 .. 28x02 .. 30x31 .. 31x28 .. 33x06x09x33 .. 34x01-12 .. 35x01x07x37 .. 36x01x02x03x04x05x06x07x08x09x36 .. 37x01x02x03x04x05x12x21 .. 38x01x21x29x37x39 .. 39x01x27x42 .. 40x01-52 .. 41x01-50 .. 42x01x02x03x04x05x06x07x08x09x10x11x12x14x15x16x17x18x19x20x21x22x24x25x26x27x31x32x33x34x35x36x37x38x39x40x41x42x43x44x45x46x47x48x49x50x51 .. 43x01x02x03x04x05x06x07x08x09x10x11x12x13x14x15x16x17x18x19x20x21x22x24x25x26x27x28x29x30x31x32x33x34x35x36x37x38x39x40x41x42x43x44x45x46x47x48x49x50x51x52 .. 44x01-53 .. 45x01-48 .. 46x01-51 .. 47x01-52 .. 48x01-55 .. 49x01-23 .. 50x01-55 .. 51x01-51 .. 52x01-50 .. 53x01-51 .. 54x01-56 .. 55x01-54 .. 56x01-55 .. 57x01-57 .. 58x01-03
[MOVE] from [N:\Media\#Unprocessed\60.Minutes.S58E03.1080p.WEB.h264-BAE.mkv] to [N:\Media\TV Shows\Adults\60 Minutes\Season 58\60 Minutes - S58E03 - The China Hack; Booms, Busts and Bubbles; The Road to Damascus.mkv]
Processed 1 file
Sending Pushover notification
Done ヾ(@⌒ー⌒@)ノ