HTTP API Mark a file as Watched
#1
Hi,

I'm building a web front end in php to manage the XBMC library via HTTP API and I'm looking for a way to mark an file/episode as watched with a command or an SQL request.

Thank's for your help!

--
'xcuse My English I'm French
Reply
#2
See the query in CVideoDatabase::MarkAsWatched() et. al.

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
Thanks Jonathan,

I think I can't call this function from the Web Interface since the argument is a C++ object.
But I've seen the SQL request in the source code to mark a movie/episode as watched, I will try this way.

Related question, I've seen "count" information about tvshow in the database, how theses informations will be up to date if I change directly episodes status by SQL?

Informations will be recomputed in the next Library Update?
Reply
#4
They're computed in the query itself, so yes, they're up to date no matter what you do.

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
#5
jmarshall Wrote:They're computed in the query itself, so yes, they're up to date no matter what you do.

Cheers,
Jonathan

The watched/unwatched count is part of an sql View, so computed on the fly?
If I changed the watched status in the "episode" table, the count will be updated in the next query for "Tvshowview", am I right?

BTW Thanks for your help Nod
Reply
#6
Exactly correct.
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
#7
It's seems I Can't perform Update Statement trougth "QueryVideoDatabase " from HTTP API, any Sql Update Statement return
Code:
# Error:Successful result Query: PRAGMA count_changes='OFF'

Am I doing wrong?
Reply
#8
Ah - looks like GetArbitraryQuery which is called from this routine can only do queries. You'd need something that does an exec(), but it doesn't look like anything that can handle that sort of thing is available over the HTTP API.

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
#9
The wiki should be updated:

Code:
http://wiki.xbmc.org/?title=WebServerHTTP-API

This is confusing:

Quote:Provides a SQL interface to the XBMC Music Database. While this command is described in this section (Retrieving Information) it is possible to use it to modify the data base.

Obviously the database can't be modified by this way!

Is there a way to do update on database than HTTP API? Can I open the database with an php SQLlite frontend while XBMC is running or the base will be corrupted?
Reply
#10
Thanks - I'll update the manual.

Ideally a new function for both databases that allow you to perform an exec rather than a query would be done.

You could use pysqlite if the db file wasn't already opened in xbmc - which is hard to determine I suspect!

Are you in a position to do up such a function yourself and submit a patch? If not, put a feature request on trac and hope that someone else gets to it Smile

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
#11
My C++ is a little bit rusty but I will try!

Is there a tutorial to submit a patch when It's done?
Reply
#12
Just post a ticket on trac and attach a diff Smile
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
#13
jmarshall Wrote:Just post a ticket on trac and attach a diff Smile

Done for the VideoDatabase part.

If you have any comments!

http://trac.xbmc.org/ticket/6006
Reply

Logout Mark Read Team Forum Stats Members Help
HTTP API Mark a file as Watched0