Reply to thread

Inker, now I have a much cleaner solution, thanks to your suggestions. I did next things:


Files VideoDatabase.cs and IVideoDatabase.cs


Added 2 methods to class VideoDatabase:

static public int CheckFileNamePresent(string strFilenameAndPath)

static public int UpdateForFileName(string strFilenameAndPath)


Implementation of these methods in File VideoDatabaseSqlLite.cs


Further in GUIVideoFiles.cs these 2 new methods are used:


In Method 'OnInfo'

line 1117 Added next code:


// Check if filename is already present in database

int lPathId = VideoDatabase.CheckFileNamePresent(strFile);

if (lPathId > 0)

{

  VideoDatabase.UpdateForFileName(strFile);

}


If you want I can PM you the files. I am not sure yet if we should bother the user with a message-box in case a filename is already present in the database. I mean, for videofiles I don't expect that different videos with the same filename (should) exist. It think it's better that we silently update the database (files and movie table) with the corrent info in this case. What's your opinion Inker?


BTW: I really enjoyed this exercise very much. Is it possible/wanted that I can help the Mediaportal Development Team with programming issues? I could for example try to solve some documented bugs.


Top Bottom