[sweeper] Custom rules to manage recordings

Having heeded the wise words on those who must be obeyed, my Sweeper antics have started to bear fruit

Though I have one or two 'is there anyway'

When creating a rule, is there anyway of having the buttons that appear at the bottom on the screen duplicated at the top, if a particular rule is quite long, it is, let's say bothersome to have to keep scrolling down each time if you want to [ run now ] or use the direct edit text feature

also the option to click [ yes or no ], a little box pops up so the cursor just has to move up slightly, yet when you want to click save, the [ yes / no ] is right at the top of the screen, when you bring the cursor down, you inevitably pass over the header resulting in the drop-down progress window appearing

lastly, when it the rules window, clicking on [ test config ], you get another window that shows how the rules will be processed, can this window be configured to either be a few pixels narrower than the parent window, or remember that is has been widened when last used

great plug-in, wish I had persevered with when I first came across it all those years ago
 
Having heeded the wise words on those who must be obeyed, my Sweeper antics have started to bear fruit

Though I have one or two 'is there anyway'

When creating a rule, is there anyway of having the buttons that appear at the bottom on the screen duplicated at the top, if a particular rule is quite long, it is, let's say bothersome to have to keep scrolling down each time if you want to [ run now ] or use the direct edit text feature

also the option to click [ yes or no ], a little box pops up so the cursor just has to move up slightly, yet when you want to click save, the [ yes / no ] is right at the top of the screen, when you bring the cursor down, you inevitably pass over the header resulting in the drop-down progress window appearing

lastly, when it the rules window, clicking on [ test config ], you get another window that shows how the rules will be processed, can this window be configured to either be a few pixels narrower than the parent window, or remember that is has been widened when last used

great plug-in, wish I had persevered with when I first came across it all those years ago

Much of the 'look and feel' of web pages can be customized without needing access to the source code by the use of CSS style sheets.
Like Sweeper they can look arcane and complex at first sight but are not that bad once you get your head around the ideas.

Fortunately there are tutorials (e.g. https://www.w3schools.com/css/) and tools to help. Depending on your browser if you right click on the part of the web page you are interested in you should be an option like 'Inspect Element' which will bring up a Developers Tool window including a style editor where you can play around seeing the effect of different options.

When you find out what works for you then the webif provides an EXTRAS.css style sheet, editable via the File editor on the diagnostics menu, where you can store your styles - this won't be overwritten when you install a new version of the webif.
 
Much of the 'look and feel' of web pages can be customized without needing access to the source code by the use of CSS style sheets.
Like Sweeper they can look arcane and complex at first sight but are not that bad once you get your head around the ideas.

Fortunately there are tutorials (e.g. https://www.w3schools.com/css/) and tools to help. Depending on your browser if you right click on the part of the web page you are interested in you should be an option like 'Inspect Element' which will bring up a Developers Tool window including a style editor where you can play around seeing the effect of different options.

When you find out what works for you then the webif provides an EXTRAS.css style sheet, editable via the File editor on the diagnostics menu, where you can store your styles - this won't be overwritten when you install a new version of the webif.
Not the answer I was expecting, well above my pay grade, anyone for tea
 
You might get a different (better) experience by using a different browser. The details you are talking about are presentation, and might not be universal.

As MymsMan indicated, unless something is actually broken the chances a presentation issue being tweaked are minimal - we are grateful we have what we have, nobody gets paid for what they have produced. Some people have personalised their presentation layer by imposing their own CSS.

If all else fails, you could stop using the GUI for sweeper rules and edit them off-line instead, however you like (or even on-line through WebIF >> Diagnostics >> File Editor).

Nonetheless, it is possible the developer will have noted your comments, and might investigate, so it is worthwhile providing feedback.
 
If all else fails, you could stop using the GUI for sweeper rules and edit them off-line instead, however you like (or even on-line through WebIF >> Diagnostics >> File Editor).
Thank Black Hole, I start a rule using the [ add rule ] button and develop it to do my intended actions for filing my recording on a folder by folder basis, some programmes get watched and deleted, some get recorded to be watched back to back at a later date, but...

Many broadcast programmes have series and episode data included making filing and sorting based on S00 and E00 fairly straightforward, other programmes are broadcast with just the episode name, this is where extensive use of Sweeper starts to show its worth, but having to create a rule for every series and episode individually starts to become tiresome, so I have utilised my spreadsheet skills and search and replace features of a technical text editor to tidy a block of text from a television scheduling site to leave just episode name, series and episode number, this is then placed in a spreadsheet, other cells then 'calculate' and the result is a valid line of code that can be pasted in to the [ Text Editor ] window of Sweeper

And yes, you are thinking correctly, if you have ten seasons, each with twenty four episodes, you will over have two hundred and forty entries in Sweeper, along with any other filing rules, and it is working fine

But having to scroll up and down to open the [ Text Editor ] option or any other option is becoming an issue, but my HTML skills are an unexplored area of coding I am yet to discover, any chance of some CSS starting pointers, for example, where are the required CSS files stored please
 
For another dose of wisdom, while the "Test current ruleset" display in the Sweeper Edit Rules web page could be restyled with CSS, that would be a bad idea because it's meant to be resizable with JS and you could easily get phantom chunks of the dialogue.

"Test current ruleset" is a fake dialogue created with nested styled <div> elements in the HTML of the page. The fake dialogue is normally hidden but the JavaScript that runs to test the ruleset unhides it and writes the results into its inner <div>.

The correct place to hit is /mod/webif/plugin/sweeper/script.js ll. 954-963:
Code:
        $('#testresults').dialog({                                              
                height: '600', width: '800',                                    
                draggable: true, resizable: true,                               
                autoOpen: true,                                                 
                buttons: {                                                      
                        "Close": function() {                                   
                                $(this).dialog('close');                        
                        }                                                       
                }                                                               
        });
WebIf fake dialogues are made with the jQueryUI dialog() API, as above, which only understands px units (supposedly, 1px is the width of the thinnest sharp line that can be displayed), or the string auto.

Modern browsers support window-based units (vw, vh -- strictly, viewport units) that are ideal for laying out fake child windows, but dialog() doesn't know about them.

Fortunately jQueryUI devs are not completely clueless and they provide window().height() and window().width() to report the size of the "viewport". So this replacement for the second line above sets the initial dialogue size to 80% of the viewport:
Code:
                height: $(window).height()*0.8, width: $(window).width()*0.8,
Adapting this to any desired relative size is an exercise for the reader.

Actually my spies (find /mod/webif -name '*.js' -exec grep -H -A 1 ').dialog(' "{}" \;) indicate that this is the only hard-wired dialogue size in the WebIf on my system and it probably should be changed.
 
Last edited:
...When creating a rule, is there anyway of having the buttons that appear at the bottom on the screen duplicated at the top, if a particular rule is quite long, it is, let's say bothersome to have to keep scrolling down each time if you want to [ run now ] or use the direct edit text feature
...
Obviously yes*, but (at least in a FireFox-like browser) you can make a bookmark with the link text javascript:document.getElementById('buttons').scrollIntoView();.
...also the option to click [ yes or no ], a little box pops up so the cursor just has to move up slightly, yet when you want to click save, the [ yes / no ] is right at the top of the screen, when you bring the cursor down, you inevitably pass over the header resulting in the drop-down progress window appearing
...
Is that supposed to happen on "Run now"? I just get an OS dialogue box in the middle of the browser display (viewport). On "Save", I get a speech-bubble style fake dialogue just above the button. While these should probably both be the same, I don't get any prompt near the top of the viewport (unless I make the browser window very short!).

* provided you or someone writes the code for it ...
 
other programmes are broadcast with just the episode name, this is where extensive use of Sweeper starts to show its worth, but having to create a rule for every series and episode individually starts to become tiresome, so I have utilised my spreadsheet skills and search and replace features of a technical text editor to tidy a block of text from a television scheduling site to leave just episode name, series and episode number, this is then placed in a spreadsheet, other cells then 'calculate' and the result is a valid line of code that can be pasted in to the [ Text Editor ] window of Sweeper

And yes, you are thinking correctly, if you have ten seasons, each with twenty four episodes, you will over have two hundred and forty entries in Sweeper, along with any other filing rules, and it is working fine
As you have identified Sweeper comes into it own for automating repetitive tasks where the same rule can be applied to dozens of matching recordings but it is probably not the most appropriate tool for renaming/moving individual programmes where a generic rule can not be created.

Since you have already developed a spreadsheet to generate sweeper rules it would not be that much different to generate the underlying commands and then copy and paste them into a command prompt and avoid the need for editing sweeper.

For example to change a recordings title (as shown on TV interface) and filename/location the commands are:
Code:
hmt +settitle "new title" filename
hmt +setfilename "new-filename" filename
mv filename.ts newfilename.ts
mv filename.nts newfilename.nts
mv filename.hmt newfilename.hmt
mv filename.thm newfilename.thm
but this could be simplified into a simple script file
 
$('#testresults').dialog({ height: '600', width: '800', draggable: true, resizable: true, autoOpen: true, buttons: { "Close": function() { $(this).dialog('close'); } } });
thanks /df

Ok, I've FTP'd the script over to my laptop from my Humax HDR Fox-T2, and opening it in [ EditPad Lite 7 ], firstly I cant seem to enter any other text or insert new lines or delete anything, it's as if the file is read only, I've checked and it appears not to be read only

would altering [ height: '600', width: '800' ] tp [ height: '600', width: '95%' ] work or is that making it too simple

How would I save the changed and send it by so the Humax will use the edited file

Thanks in advance
 
Thank you MymsMan

Sorry, I only use the epname, series and episode details to identify a particular recording, it then gets moved to the appropriate folder, no renaming is being performed, may be one day I'll wake up screaming and realise how to do coding more efficiently

But many thanks for your efforts
 
How would I save the changed and send it by so the Humax will use the edited file
Why not do it on the HDR-FOX directly? Open the file in WebIF >> Diagnostics >> File Editor, save as a different filename for backup purposes, then close and reopen the original and make the changes you want.

I'm just telling you how you can... I'm not necessarily recommending that you do (it's out of my league).
 
  • Like
Reactions: /df
Back
Top