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: 81754" data-attributes="member: 10451"><p>Inker many thanks for your info. You are absolutely right. I completely oversaw this issue.</p><p></p><p>I was thinking what else is the most elegant solution and came up with the next solution.</p><p></p><p>\Databases\Video\SqlLite\VideoDatabaseSqlLite.cs</p><p>Line 169:</p><p></p><p>Just adding next piece of code on the same spot:</p><p></p><p>strSQL = String.Format("update files set idpath={0} where strFileName='{1}'", lPathId, strFileName);</p><p>results = m_db.Execute(strSQL);</p><p></p><p>just before the already existing code</p><p></p><p>strSQL = String.Format("select * from files where idpath={0}", lPathId);</p><p>results = m_db.Execute(strSQL);</p><p></p><p>This fix the problem and has an extra positive side-effect (assuming that filename will always be unique for each video-file, which in my opinion is a valid assumption). This way the database will always be up to date, even when moving files to another directory. There is only one minor issue. The change will not be visible in case the new directory is not already part of the 'titles' table. However nothing to worry about, because with the very first update of the new directory to this table, the problem is again automatically solved.</p><p></p><p>What do you think of this simple but elegant solution Inker?</p><p></p><p>PS: Probaly it's even better to put the updating between a transaction.</p></blockquote><p></p>
[QUOTE="HenriM, post: 81754, member: 10451"] Inker many thanks for your info. You are absolutely right. I completely oversaw this issue. I was thinking what else is the most elegant solution and came up with the next solution. \Databases\Video\SqlLite\VideoDatabaseSqlLite.cs Line 169: Just adding next piece of code on the same spot: strSQL = String.Format("update files set idpath={0} where strFileName='{1}'", lPathId, strFileName); results = m_db.Execute(strSQL); just before the already existing code strSQL = String.Format("select * from files where idpath={0}", lPathId); results = m_db.Execute(strSQL); This fix the problem and has an extra positive side-effect (assuming that filename will always be unique for each video-file, which in my opinion is a valid assumption). This way the database will always be up to date, even when moving files to another directory. There is only one minor issue. The change will not be visible in case the new directory is not already part of the 'titles' table. However nothing to worry about, because with the very first update of the new directory to this table, the problem is again automatically solved. What do you think of this simple but elegant solution Inker? PS: Probaly it's even better to put the updating between a transaction. [/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