Req The addition of an ID field to smartplaylist's rule field
#1
Question 
I would like to request that an "ID" field be added to the list of rules that smartplaylists can use to search the database with.
So that a smartplaylist made with:

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="movies">
    <name>IMDB List</name>
    <match>one</match>
    <rule field="id" operator="is">
        <value>tt0062622</value>
    </rule>
    <rule field="id" operator="is">
        <value>tt0034492</value>
    </rule>
    <rule field="id" operator="is">
        <value>tt0054698</value>
    </rule>
    <order direction="ascending">filename</order>
</smartplaylist>

would yield a playlist built from the IDs (IMDB IDs) held in the library database and output this:

2001 - A Space Odyssey (1968)
Bambi (1942)
Breakfast at Tiffany's (1961)


IMDB has lot's of user created lists, and they can be exported to a .csv that can easily be turned into a smatplaylist .xsp file. They all contain the IMDB ID, and that field is already held in the XBMC database so it would be easy to match up (trying to match titles and filenames is a nightmare).
XBMC database example:
Code:
<filenameandpath>smb://192.168.0.104/Media/Movies/Family/Bambi (1942).avi</filenameandpath>
<basepath>smb://192.168.0.104/Media/Movies/Family/Bambi (1942).avi</basepath>
<id>tt0034492</id>
<genre>Animation</genre>


This came about from me trying to create a smartplaylist from a IMDB user list for the "National Film Registry".
I got it to work somewhat by filename (year) matching but XBMC hates trying to match 680 lines of huge sets of strings, I can only guess that a simple ID rule match would be easier on the routine.

Side note: It would also be nice to have a wildcard for string comparing like "2001*A Space Odyssey*1968", right now "contains" only deals with absolute strings.

Afterthought: Why not just allow rules to support ALL tags that the database supports? ID would be nice, but there are other tags that I'm sure would allow for some cool things to be done. (not that 99.9% aren't already available)
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#2
IMDB id should already be there as "imdbnumber", so it would just be a matter of amending SmartPlaylist.cpp to add this in to DatabaseUtils.h (add FieldIMDB), add to the struct at the top of SmartPlaylist.cpp and then to GetFields(). You'll need to lookup the various localised strings and the like.

Would be a great first project for someone with a desire to dabble in XBMC code (i.e. mostly copy n paste).
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
As you can see I have not been able to amend this, any other takers?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#4
Yep this would be very nice.

Having IMDB user created nodes would be awesome!
Reply

Logout Mark Read Team Forum Stats Members Help
The addition of an ID field to smartplaylist's rule field0