home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
VideoDatabase Optimalisation (don't use path in lookup)
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="HenriM" data-source="post: 81962" data-attributes="member: 10451"><p>Inker, now I have a much cleaner solution, thanks to your suggestions. I did next things:</p><p></p><p>Files VideoDatabase.cs and IVideoDatabase.cs</p><p></p><p>Added 2 methods to class VideoDatabase:</p><p>static public int CheckFileNamePresent(string strFilenameAndPath)</p><p>static public int UpdateForFileName(string strFilenameAndPath)</p><p></p><p>Implementation of these methods in File VideoDatabaseSqlLite.cs</p><p></p><p>Further in GUIVideoFiles.cs these 2 new methods are used:</p><p></p><p>In Method 'OnInfo'</p><p>line 1117 Added next code:</p><p></p><p>// Check if filename is already present in database</p><p>int lPathId = VideoDatabase.CheckFileNamePresent(strFile);</p><p>if (lPathId > 0)</p><p>{</p><p> VideoDatabase.UpdateForFileName(strFile);</p><p>}</p><p></p><p>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?</p><p></p><p>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.</p></blockquote><p></p>
[QUOTE="HenriM, post: 81962, member: 10451"] 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. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
VideoDatabase Optimalisation (don't use path in lookup)
Contact us
RSS
Top
Bottom