That's due to the web interface update. I have a new sweeper package almost ready which will fix that.I seem to have some missing icons on the sweeper page (Firefox shows the broken image symbol). I presume that the problem is fairly recent as Duplicate Rule and Edit Condition were show broken, so I did a page refresh to see if that would help and the Delete Rule icon has now gone as well!
Yes, and the rule is applied to recordings one by one rather than to the folder as a whole.So now every recording is tested individually before being processed, even in recursed folders (as opposed to if the first one tested passes they all pass)?
# Remove Film Timestamp
genre Film filename *_********_**** action {renamefile {%orig%regsub,_********_****\s,,}}
28/06/2016 18:52 - + Sweeper processing /media/My Video/Departures_20160621_0207.ts
28/06/2016 18:52 - Processing [genre Film filename *_********_**** action {renamefile {%orig%regsub,_********_****\s,,}}]
28/06/2016 18:52 - genre(Film)
28/06/2016 18:52 - MATCH
28/06/2016 18:52 - filename(*_********_****)
28/06/2016 18:52 - MATCH
28/06/2016 18:52 - action(renamefile {%orig%regsub,_********_****\s,,})
28/06/2016 18:52 - ACTION: renamefile(%orig%regsub,_********_****\s,,) [0]
28/06/2016 18:52 - Expanded [%orig%regsub,_********_****\s,,] -> [Departures_20160621_0207]
28/06/2016 18:52 - - Calling expand_regsub({_********_****\s} {})
28/06/2016 18:52 - Error. %regsub - couldn't compile regular expression pattern: nested count
28/06/2016 18:52 - Result: (Departures_20160621_0207)
28/06/2016 18:52 - Renaming /media/My Video/Departures_20160621_0207.ts to Departures_20160621_0207
28/06/2016 18:52 - ... ERROR Target already exists
I want a rule to delete the timestamp from the filenames of films. I set up the following:
...Code:# Remove Film Timestamp genre Film filename *_********_**** action {renamefile {%orig%regsub,_********_****\s,,}}
What am I doing wrong?
genre Film filename *_????????_???? action {renamefile {%orig%regsub,_\d{8}_\d{4},,}}
Also, sometimes films are recorded in two parts (e.g. when there is a news bulletin in the middle). To cope with this, it would be useful to append a number (e.g. '_2') to the end of the target filename if a file of the same name already exists.
genre Film filename *_????????_???? action {set {newname=%basename%regsub,_\d{8}_\d{4},,}}
varset newname fileexists %%newname.ts action {set {newname=%%newname_2}}
varset newname fileexists %%newname.ts action {set {newname=%%newname%regsub,_\d$,_3,}}
varset newname fileexists %%newname.ts action {set {newname=%%newname%regsub,_\d$,_4,}}
varset newname action {renamefile %%newname}
Strange - works for me. A slightly more optimised version is this:Thanks very much. I can't get the second part to work though. I pasted in the section to sweeper.conf and it presents each line with 'varset' as a discrete unnamed rule. If I remove the carriage returns and leave one space between each line, then sweeper ignores them.
genre Film filename *_????????_???? action {set {newname=%basename%regsub,_\d{8}_\d{4},,}}
lastrule "" fileexists %%newname.ts action {set {newname=%%newname_2}}
lastrule "" fileexists %%newname.ts action {set {newname=%%newname%regsub,_\d$,_3,}}
lastrule "" fileexists %%newname.ts action {set {newname=%%newname%regsub,_\d$,_4,}}
varset newname action {renamefile %%newname}
genre Film filename ~_\\d{8}_\\d{4}$ action {renamefile %asuniqfilename/%regsub:%orig:_\\d{8}_\\d{4}::/}}
humax# ls -1
The Boat that Rocked_20160601_1234.hmt
The Boat that Rocked_20160601_1234.nts
The Boat that Rocked_20160601_1234.ts
The Boat that Rocked_20160601_2345.hmt
The Boat that Rocked_20160601_2345.nts
The Boat that Rocked_20160601_2345.ts
The Boat that Rocked_20160601_3456.hmt
The Boat that Rocked_20160601_3456.nts
The Boat that Rocked_20160601_3456.ts
humax# cat .sweeper
genre Film filename ~_\\d{8}_\\d{4}$ action {renamefile %asuniqfilename/%regsub:%orig:_\\d{8}_\\d{4}::/}}
humax# /mod/webif/plugin/sweeper/test `pwd`
humax# ls -1
The Boat that Rocked.hmt
The Boat that Rocked.nts
The Boat that Rocked.ts
The Boat that Rocked_2.hmt
The Boat that Rocked_2.nts
The Boat that Rocked_2.ts
The Boat that Rocked_3.hmt
The Boat that Rocked_3.nts
The Boat that Rocked_3.ts
Thanks. The new one line rule is working fine with the latest version of Sweeper. I only used the 'Test config' option with the previous version of the rule, I did not actually run the rule. With the latest version too, in test mode, the log does not show that the '_2' suffix is added when you have two files with the same base filename, it just shows that the timestamp has been removed. It does show that the suffix is added if you actually run the rule.Strange - works for me. A slightly more optimised version is this:
Code:genre Film filename *_????????_???? action {set {newname=%basename%regsub,_\d{8}_\d{4},,}} lastrule "" fileexists %%newname.ts action {set {newname=%%newname_2}} lastrule "" fileexists %%newname.ts action {set {newname=%%newname%regsub,_\d$,_3,}} lastrule "" fileexists %%newname.ts action {set {newname=%%newname%regsub,_\d$,_4,}} varset newname action {renamefile %%newname}
That's four separate rules.
I'll update sweeper tonight with a couple of new features and then you will be able to use the following single rule to achieve this. The new in-line regsub makes for them more readable too (IMHO).
Code:genre Film filename ~_\\d{8}_\\d{4}$ action {renamefile %asuniqfilename/%regsub:%orig:_\\d{8}_\\d{4}::/}}
Example:
Code:humax# ls -1 The Boat that Rocked_20160601_1234.hmt The Boat that Rocked_20160601_1234.nts The Boat that Rocked_20160601_1234.ts The Boat that Rocked_20160601_2345.hmt The Boat that Rocked_20160601_2345.nts The Boat that Rocked_20160601_2345.ts The Boat that Rocked_20160601_3456.hmt The Boat that Rocked_20160601_3456.nts The Boat that Rocked_20160601_3456.ts humax# cat .sweeper genre Film filename ~_\\d{8}_\\d{4}$ action {renamefile %asuniqfilename/%regsub:%orig:_\\d{8}_\\d{4}::/}} humax# /mod/webif/plugin/sweeper/test `pwd` humax# ls -1 The Boat that Rocked.hmt The Boat that Rocked.nts The Boat that Rocked.ts The Boat that Rocked_2.hmt The Boat that Rocked_2.nts The Boat that Rocked_2.ts The Boat that Rocked_3.hmt The Boat that Rocked_3.nts The Boat that Rocked_3.ts
4952 01/09/2016 22:03:15 - Unknown sweeper rule clause '::sweeper::,�h��R<0�h��R<0�h�*S�0�h�
4951 01/09/2016 22:03:15 - Unknown sweeper rule clause '::sweeper::(�*HsR
50 29/08/2016 22:17:41 - @ /mod/webif/plugin/sweeper/auto.hook::205
49 29/08/2016 22:17:41 - Plugin error: expected integer but got ""
I don't think you can edit existing folder names with Sweeper, though I stand to be corrected on this. The Newk package is your best bet as it removes such prefixes from folder names while the recordings are in the schedule, though it does not change the name of existing folders. Packages like Newk haven't been integrated with real time scheduling yet, so if you use RTS to set up a recording you either have to then edit the folder name in the schedule yourself or let Newk do it, which will require a reboot between scheduling and the recording start.I have set up rules to remove 'New' from recordings but cannot find a way to remove it from the folders containing those recordings. Is it possible to do so? I've read my way through the previous 10 pages and have failed to find a reference.