View Issue Details

IDProjectCategoryView StatusLast Update
0011491MMW v4Framework: Scripts/Extensionspublic2013-11-19 14:38
Reporterzvezdan Assigned To 
PrioritynoneSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Summary0011491: Ability to assign some indentifier to some playlists needed
DescriptionHere are two examples with my existing scripts. Inherit Child Playlists allows parent auto-playlists to optionally inherit their child playlists. The parent playlist marked for inheritance is just auto-playlist with criterion Playlist is xx or yy or zz... The script is heavily based on database triggers which fires e.g. when user adds or removes some playlist to the parent playlist marked for inheritance, so it could modify its content properly.

I have playlists marked for inheritance using Comment field of the Playlists table, but I don't like such solution because I am using something that is not intended for such purpose. As far as I know, you are not using that field in the program, but maybe that would change in the future and then my script will not work anymore.

The second script is Magic Nodes which has the option to create static playlists. Since you have a problem assigning events to the Playlists nodes, which I already reported before(http://www.ventismedia.com/mantis/view.php?id=6729), and because of displaying items for the context menu related to the selected node, my script needs to handle OnTrackListFilling event where it checks if selected playlist node is actually a node created by itself.

That check could be rather time-consuming since it tests all Magic Nodes' masks and related group names/captions against playlist's path to the selected playlist node, which is not recommended for an event handler that is executing whenever user clicks some node in the tree. It would be much better if I could assign some identifier to those playlists/nodes created by my script, but there we have one another problem because MM doesn't remember CustomDataID, CustomData, CustomNodeID, CustomObject or anything else for playlist nodes as soon as you collapse/expand them.

So, it would be nice if we could assign some identifier to the playlists generated by scripts which would be stored in the database. You could implement my suggestion in two ways. Firstly, you could add one new field to the Playlists table specifically for that, but that solution would require the modification of the database structure and maybe could break some compatibility.

The another solution would be using the existing Persistent field. I am not sure how you are using it in the program, but I suppose you have reserved that field for built-in auto-playlists that comes with the program. It seems to me that it currently has only two possible states 0 (NULL) and 1, but we could use it for our needs as well with values greater than 1. For example, if my script assign 2 to it, it will know that such playlist is created by itself.

I think that you don't have too much work to implement such solution. You just need to check in your program that you are using exclusively the conditions "Playlists.Persistent = 1" or "... <> 1" and you should avoid conditions "Playlists.Persistent = 0", "... <> 0", "... IS NULL" or similar since the identifier 2 (or greater) means that such playlists would not be persistent as well.

If you decide to implement this suggested database field, maybe you could add one new related property to the Playlist object as well, let's call it PlaylistType similarly to the NodeType property for nodes.
TagsNo tags attached.
Fixed in build

Relationships

related to 0006729 assignedLudek ISDBTreeNodeEvents::OnNodeEdited and other events needed for nodes from Playlists branch 

Activities

There are no notes attached to this issue.