Req New SmartPlayList rule -- Audio Track Count
#1
Hey, guys -- I've twiddled around in the SmartPlayList code to see about adding a rule where one could select videos that have multiple audio tracks.

I find this idea useful because I'm a big fan of commentaries -- and finding them with most skins is very difficult (only a few skins show the audio / subtitle info in navigation screens).

At any rate, I'm NOT a C++ programmer, and GIT is a wilderness to me. I was lucky to pull the clone and work from there and figure out how to compile it ... Smile

At any rate, here's what I modified -- does this look useful? If so, can someone perhaps guide me through the Git wilderness, or just claim this code for themselves and put it into the

This DOES seem to work OK -- it works for movies and TV shows. Of course, it adds a new variable to the rules so the wiki's would need updating, and I'm not sure if I violated any rules about where the string got added in strings.po or anything.

I'm willing to learn, but I find this addition to be VERY useful. If I could figure out how to get this back into Gotham (which is what I'm using on my chromeboxes) -- I'd do it in a heartbeat.

xbmc/addons/resource.language.en_gb/resources/strings.po
Code:
12601c12601,12606
< #empty strings from id 21481 to 21601
---
> #: xbmc/playlist/SmartPlayList.cpp
> msgctxt "#21481"
> msgid "Audio Track Count"
> msgstr ""
>
> #empty strings from id 21482 to 21601

xbmc/utils/DatabaseUtils.h
Code:
61a62
>   FieldAudioCount,

xbmc/playlists/SmartPlayList.cpp
Code:
105a106
>   { "audiocount",        FieldAudioCount,              CDatabaseQueryRule::NUMERIC_FIELD,  NULL,                                 false, 21481 },
432a434
>     fields.push_back(FieldAudioCount);
852a855,856
>   else if (m_field == FieldAudioCount)
>     query = negate + " EXISTS (SELECT 1 FROM streamdetails WHERE streamdetails.idFile = " + table + ".idFile AND streamdetails.iStreamType=1 GROUP BY streamdetails.idFile HAVING COUNT(streamdetails.iStreamType) " + parameter + ")";
Reply
#2
Hi TonyPh12345,

if you are willing to learn Git, I can recommend tryGit.
I don't know what OS you use for developing, but if it is windows I can recommend SourceTree. I think the most of our developers prefer the console under linux.
Here you can also find a small text about submitting to Kodi.

It's not so hard to get code to the XBMC repo.
- Create a Github account
- Fork XBMC repo
- Clone the forked repo
- Create a new branch in your local repo
- Commit and push your work to this new branch on Github
- Go to your Github account and select the xbmc repo
- Search for the green button to create a pull request
- Write a nice text to explain your work
Latest news about AudioDSP and my libraries is available on Twitter.

Developers can follow me on Github.
Reply
#3
Done. PR8333

Thanks for the tip!
Reply
#4
Tip: if you type PR_8333 without the underscore it will link it like this: PR8333
Reply
#5
That's slick. Thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
New SmartPlayList rule -- Audio Track Count0