Superb quality and spec AB-Com PULSe 4K SE. Crazy offer! Only £99! FREE UK DELIVERY! 4K UHD, Enigma 2, Multiboot 4 images & more!...
Superb quality and spec AB-Com PULSe 4K Rev II Twin Satellite tuner only £149! FREE UK DELIVERY! 4K UHD, Enigma 2, SATA HDD facility, Multiboot 4 images & more!...

[ViX_Misc] How do I add tags to timers?

Look at my screenie:
OK. So this is what you want to be sorted - not adding "sort by tags" as another option to sort.
Should be somewhat simpler....(famous last words).

However - do you actually run all recording not the movie folder and just rely on tags to sort? Personally I'd find this difficult to use. File systems make great hierarchical databases (given that they are hierarchical) and so I use them as such. So I create a set of locations for types of programmes and when setting up auto-timers I set the relevant location for the type of programme. Then, when browsing the recordings I only see the set of recordings for each directory. So it's a bit like your tags - except I have sorted sub-entries for each.
 
Tag sorting - sorted.

OK. So this is what you want to be sorted - not adding "sort by tags" as another option to sort.
Should be somewhat simpler....(famous last words).
Done. Given the simplicity, I'll just post the on-line diff:

Code:
        def showTagsMenu(self, tagele):
                self.selected_tags_ele = tagele
-               lst = [(_("show all tags"), None)] + [(tag, self.getTagDescription(tag)) for tag in self.tags]
+               lst = [(_("show all tags"), None)] + sorted([(tag, self.getTagDescription(tag)) for tag in self.tags])
                self.session.openWithCallback(self.tagChosen, ChoiceBox, title=_("Please select tag to filter..."), list = lst, skin_name = "MovieListTags")

So just wrap sorted() round the list from the for loop in showTagsMenu (in MovieSelection.py).
 
Improved fix...

Actually a better fix is to sort the tags before making the list, rather than sorting the (larger) list later.

So wrap the sorted() around the self.tags instead, namely:
Code:
              lst = [(_("show all tags"), None)] + [(tag, self.getTagDescription(tag)) for tag in sorted(self.tags)]
 
OK. So thisHowever - do you actually run all recording not the movie folder and just rely on tags to sort?
Yes, I do.
Main reason is the fact, that it is now easy to 'jump' between 'tags' (i.e. grouped, which works fine for me) and chronological (i.e. 'show all tags' and hence reverting to the 'all' list in the last selected sorting.
 
Not only is there already a pop-up sort menu, but you can already attach it to the blue button.
While in a Movie list use Menu->Settings..., scroll down to "blue button" and change the binding to be "Sort by", rather than "Sort".
So I'll assume that is now done...
LOL I never knew that :eek:

So that was an easy job than; I'll think of something more complicated next time :D
 
So that was an easy job than; I'll think of something more complicated next time :D
Well, I do have another sorting task - which you won't know of as an issue (given what you said above).
If you have multiple locations set then they get presented in a non-sorted order (the creation order, I think).
So I'd like that sorted (it's config.movielist.videodirs).
Rather than sort it at each usage (it's used in a few menus, and also by OpenWebif) I reckon that sorting it at the time it is set/changed would be best. Assuming that only occurs in one place...
 
Rather than sort it at each usage (it's used in a few menus, and also by OpenWebif) I reckon that sorting it at the time it is set/changed would be best. Assuming that only occurs in one place...
Well, I can do a reasonable fix with another one-liner, add sorted() change.

This sorts the Locations at load time - which means that if you add a new one it will show at the end of the list until the GUI is restarted. Which should be good enough.

The change is in the load method of ConfigLocations in Components/config.py (line 1511 in Apollo.098). Just wrap sorted() around tmp in the for loop control:
Code:
                locations = [[x, None, False, False] for x in sorted(tmp)]
 
Additonal code to sort Locations at the time of adding

I've worked out how to get the "live list" sorted too.

In do_addbookmark in Screens/MovieSelection.py, change (in the else branch):
Code:
                        config.movielist.videodirs.value += [path]
to be
Code:
                        svd = sorted(config.movielist.videodirs.value + [path])
                        config.movielist.videodirs.value = svd


Oddly (to me) trying this:
Code:
                        config.movielist.videodirs.value = sorted(config.movielist.videodirs.value)
just before the save() failed - as did assigning to a temporary variable to do the sort. It just left the new value at the end....
Obviously I need to read up on assignments in Python.
 
I've worked out how to get the "live list" sorted too.
Well, I thought I had. It was working when I tested it, but an update to 099 and re-applying the same code has resulted in it not working. :confused:
The code in #49 is OK, though.
 
I have a solution...

Although the code seemed as though it should work (AddPopup() calls showed the array increasing in length by one, and the last item on the new list was the highest alphabetic one, not the just-added one) it didn't seem to affect the Location list.

Presumably something was being cached? (I did notice that the /etc/enigma/settings file doesn't get updated by init 4/init 3 - only by a GUI restart? But init 4/init 3 will lose changes!!)

So I decided just to reload the value after saving it.

The else clause in do_addbookmark() in Screens/MovieSelection.py is now:
Code:
                        config.movielist.videodirs.value += [path]
                        config.movielist.videodirs.save()
# reload to sort on adding...
                        config.movielist.videodirs.load()
 
Last edited:
enigma2 stopping - BUG

I did notice that the /etc/enigma/settings file doesn't get updated by init 4/init 3 - only by a GUI restart? But init 4/init 3 will lose changes!!
That's a bug.

It looks as though if enigma2 is restarted from its own menu it saves pending updates to settings.

However, "init 4" will stop it by sending a signal (/etc/inittab defines it to only run in level 3) and it looks as though the code which handles this (if any) doesn't do the pending saves. It should.
 
On further thinking this bug is related to the reason that running shutdown on the box isn't the same as shutting it down from the GUI. Looks like init state changes just chop the enigma2 process, rather than getting it to shutdown properly.
I'll have a look, but am slightly confused by enigma2 being C++ code that runs python.
 
Before looking into all your posts:
1- On 'init 4' the actual settings will not be saved in the settings file. It's more like pulling the plug. When you change settings via the GUI they will be saved once the menu has been left completely.
2- Sorting of recordings in different directories can be done in two ways: 'one-for-all' and all individual. Therefore the record list context menu has the option 'Use individual settings for each directory'.
Be aware that storing sortings settings requires write access to that directory.
 
Before looking into all your posts:
1- On 'init 4' the actual settings will not be saved in the settings file. It's more like pulling the plug. When you change settings via the GUI they will be saved once the menu has been left completely.
Given that "init 4" is required to shutdown the GUI - and hence needed if you need to, say, remove the epg.dat file (and features prominently on the "how to update" page) - it should save modified settings.
And config changes are not written off to the settings file when you leave a menu - they only get written when the GUI is shut down from its menu - which is why this is an issue.

2- Sorting of recordings in different directories can be done in two ways:
It's not the sorting of directory contents that was the issue - it the sorting of the list of Locations in any selection menu - which currently isn't sorted.
If you don't use Locations then you won't notice it (as you'll only have one) but I do use them (I have 14).
 
Last edited:
Given that "init 4" is required to shutdown the GUI - and hence needed if you need to, say, remove the epg.dat file (and features prominently on the "how to update" page) - it should save modified settings.
And config changes are not written off to the settings file when you leave a menu - they only get written when the GUI is shut down from its menu - which is why this is an issue..

Nope, you misunderstood.

'init 4' is a forced kill of enigma2 (and that's more than just the GUI). So how could E2 save settings when it's being killed? Like I said: it's like pulling the plug.

And trust me: settings are being saved on exiting the menu. And indeed, also on closing E2 properly (i.e. via the GUI).
The need to kill E2 if you want to delete epg.dat is because all EPG data is kept in memory. So if you don't kill E2 it will save those data again, irrespective of the fact that you deleted the file manually.
 
If you don't use Locations then you won't notice it (as you'll only have one) but I do use them (I have 14).
Actually it's different per box: the number of locations varies between 5 and 15.
I never found this an issue; I never have any trouble finding the correct one.
An other way to 'overcome' that issue is to use bookmarks n the movie-directory.
 
Nope, you misunderstood.
I do understand how init works....
'init 4' is a forced kill of enigma2 (and that's more than just the GUI). So how could E2 save settings when it's being killed? Like I said: it's like pulling the plug.
It tells init to switch to level 4, which means that the enigma.sh process (configured to run only in level 3) is sent a SIGTERM. It can handle that if it wishes. Indeed the C++ enigma code has a SIGTERM handler.
And trust me: settings are being saved on exiting the menu.
Trust me - they are NOT.
I was looking at the timestamp (and contents) on the settings file as I changed entries in the Locations list and it was not changed until the GUI was shutdown via the menu.
 
Last edited:
Actually it's different per box: the number of locations varies between 5 and 15.
The Locations list is user-defined (plus some standard ones)
I never found this an issue; I never have any trouble finding the correct one.
It's the same as you wanting your tags sorted!
An other way to 'overcome' that issue is to use bookmarks n the movie-directory.
That's what Locations are. When you add a bookmark they get added to the Locations list
 

OpenViX Feeds Status

Back
Top