question about how XBMC updates the library
#1
I have a question about the way XBMC does updates. Say I have a file of a tv episode that is a 720 web-dl and I replace it with a 1080p blu ray rip. Is it possible to update the XBMC library to see that as the same episode? Because the only way I can see to do it is to remove the old one from the library and add the new one, but that gets rid of other attributes like watched status and the like in the process. A remove and add is not the same as an update. When using media manager programs that replace files with better quality ones in bulk this can become an even bigger issue. Is there a way to accomplish this through the API? I have a script that will do this flawlessly through a SQL query but doing so through the API will make it much better for other programs. If not, can the API, hypothetically, be expanded to accomplish this?
Reply
#2
I personally use trakt addon.

Trakt keeps record of my watched status but does not care abut quality.

after sinc your episode will be marked as seen, bonus is it will sinc your library in few moments after install. Smile
Reply
#3
yes, i am aware of trakt but that does not do what i need.
Reply
#4
As long as your old and new files are named the same i.e.

Show Name S0XE0X Description.ext
and not
Show Name S0XE0X Description Quality.ext

XBMC will recognize the old and new as the same as far as watched status.

I know that is ghetto compared to a real DB update but will save your watched status if that is your main concern.
יונתן בן-חיים
Reply
#5
yes, but then all of the info will be incorrect and it doesnt actually update anything. and it is not just the watched status, that is just an example of one of the symptoms of the problem.

the actual problem is that, unless i am overlooking something, there is no mechanism for xbmc to update a file record in it's database, only remove and add. so media managers like sickbeard or nzbdrone have to delete a record and add a new one instead of just updating the current one which leads to issues like lost watched status, bookmarks, and other attributes associated with a file.

i just wanted to check here first but maybe i should submit a feature request.
Reply
#6
Do you want to automate it or just do it manually occasionally?
Reply
#7
Automate it through the API. Manually doing it occasionally is not a problem as that can be easily accomplished with a SQL query. In fact I do have an automated solution to this in the form of a custom script for Sickbeard that involves a SQL query that has been working perfectly since I implemented it 6 months ago. However this is not ideal as it makes it more complex for the user. An API solution would be ideal, making it transparent for the user as well as increasing extensibility.

I have been looking for an already existing solution to this for a while now and am fairly confident that it does not exist and this has not been requested so as such I am submitting a feature request:
http://forum.xbmc.org/showthread.php?tid=176018
Reply
#8
Change the filename in the db
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#9
(2013-10-19, 00:50)nickr Wrote: Change the filename in the db

Yes, I know. If you had read the whole post, you'd know that this is what I have been doing. My question was whether or not this is supported by the API.
Reply
#10
I am not sure that an SQL query is any harder or easier than a JSON-RPC call, but an API function would (hopefully) survive a change in db structure from version to version.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#11
Right and that's mainly my reasoning. API would be better supported for third party programs. Using the SQL method would require more frequent updates to the code, backward compatibility would be a must and might require a new query for every revision (not likely though), and it would require the user to provide additional configuration details for the SQL database. Then you have some that claim using the SQL method is a big no no as you shouldn't be messing with another program's database. Rolleyes
Reply

Logout Mark Read Team Forum Stats Members Help
question about how XBMC updates the library0