Video Database and Filenames.
#1
I'm trying to write a script that grabs all of the viewed tv episodes. Shouldn't be too hard, right? Well.. I keep running into stupid road-blocks. I know there is a way around, but I simply can't find it anywhere on the internet.

Ok, what I have right now is the ability to see if an episode has been viewed. Easy:
Code:
xbmc.executehttpapi('queryvideodatabase(select c00 from episode where c08)')
This lists the name of every episode that has been viewed.
That's exactly what I want.
However, for some reason I cannot add these files to a playlist simply by name (something that, based on the docs I have seen it seems like you should be able to do).. and unfortunately, I cannot get SQL to accept an outside variable, or search within two tables.. so I can't find the actual filenames of the episodes. (With actual filenames, I know that I can get them to play.)

The end idea is to be able to basically have the script create a tv show from your downloaded tv episodes. (However, I only want watched tv shows.. Who wants it to play the finale of Battlestar Galactica when you are in the middle of the third season?) While this kind of flies in the face of the point of having everything downloaded, my wife still likes having cable simply so that she doesn't have to choose something to watch.. Or so she can put something on and do something else. She doesn't want to watch a new episode of something while she's cooking, but it is nice to be able to watch something. I know that I could make a playlist of all the watched tv shows, and just shuffle it (and that's what I'll do now..) but eventually I'd like to be eventually have the script display a sort of "coming up" screen..
I have a feeling that it would be easy to recreate an [adult swim]-like feel for it too..

Anyway, the most frustrating part is that in the XBMC Database wiki page it says:
Quote:This query gets just the path and filename of all of the video files from season two of Chuck.

If you're not familiar with SQL queries, this query probably looks pretty complicated.
That sounds exactly like what I need. Problem: There is no query listed.

Any help, or at least pointers in the right direction would be fantastic!

Thanks!
- Derek
Reply
#2
Isn't there an xbmcAddToPlaylistFromDb() or some such - perhaps it only works for music?

If not, your query needs to be fetching from the movieview view, which contains path and filename in separate columns. Note that it may not be a simple matter of appending the path and filename together (think stacks, rars, multipath stuff).

You could just create a smartplaylist to do it for you, ofcourse.

Cheers,
Jonathan
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
Smart playlists don't work correctly for this. I tried making a smart playlist that included only episodes that had a playcount of greater than 0, and it included every episode in my library.
Not sure why. Fresh install of XBMC Stable, with a brand new library.
Researching the xbmc AddToPlaylistFromDB()... Actually, it does exist in the SVN as of January 25th, and will be in 9.04.. And it works for both video & music.
Perfect!

Now to figure out how it works... (It's in SVN, but the there seems to be very little documentation on it...)

thanks!

-Derek
Reply
#4
Smartplaylists for playcount work just fine in SVN.

Note that it's just recently been moved in the db - it now resides in the files table, rather than the movie table as of v24 of the videodb.
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
#5
this command doesn't seem to work properly for video files. I am able to add videos to the playlist but then xbmc doesn't want to play them.

here are the commands I am trying:

Quote:http...command=addtoplaylistfromdb(episodes; idEpisode=3)

http...command=addtoplaylistfromdb(movies; idMovie=3)

in both cases the correct item appears to be added to the playlist but won't play. Sometimes when I click on the file in the playlist nothing happens, and sometimes I get the following message:

"Playback failed One or more items failed to play. Check the log file for details."

bummer. I tried with the last official build, and also with the latest build I could find:
xbmc-r32840-Dharma.exe
Reply

Logout Mark Read Team Forum Stats Members Help
Video Database and Filenames.0