Req Extend API to allow for replacing/updating media files
#1
Right now XBMC has no mechanism for updating a media file. For example, in directory "/home/user/TV/Show/" the file Show.Name.s01e01.720p.HDTV.X264-Group.mkv
is replaced with Show.Name.s01e01.1080p.bluray.X264-Group.mkv. Upon a library update the old record is removed and the new record added but any metadata associated with it is lost. Yes, I am aware trakt can restore some of this but it does not really address the issue, merely works around a small part of it in a much more complicated manner than the problem requires.

Media managers like Sickbeard and NZBDrone will replace files in bulk which will multiply the problem. I have a customized script I wrote for Sickbeard that will mimic this functionality by directly changing XBMC's SQL database but I think an API solution would be best, allowing other third party programs to utilize this solution and more effectively.

The way I see it working is the API being extended to handle a "file replace" or "file update". A media manager would pass along the name and location of a new file as well as the old file through the API, after which the record of the old file is looked up and changed to reflect the new file name. This is similar to the SQL solution I have been using for the last six months but done through the API.

Here is the query I have been using where $DFescaped is the deleted file and $NFescaped is the new file:
Code:
query=`mysql -uroot -proot -e 'START TRANSACTION;
UPDATE MyVideos75.files SET strFilename="'$NFescaped'" where strFilename="'$DFescaped'";
UPDATE MyVideos75.episode SET c18 = (SELECT concat ((SELECT strPath from MyVideos75.path where path.idpath= (SELECT idpath from MyVideos75.files where strFilename="'$NFescaped'")), "'$NFescaped'")) where c18 =(SELECT concat ((SELECT strPath from MyVideos75.path where path.idpath= (SELECT idpath from MyVideos75.files where strFilename="'$NFescaped'")), "'$DFescaped'"));
COMMIT'`
Reply
#2
I second this request. It would be a godsend for us Sick Beard users who download a lower quality initially to have it as soon as possible but then replace that with a higher quality version for keeping. It drives me nuts to watch an episode only to later see it marked unwatched in XBMC because Sick Beard replaced the original with a higher quality version.
Reply

Logout Mark Read Team Forum Stats Members Help
Extend API to allow for replacing/updating media files0