Opened 19 years ago

Last modified 18 years ago

#2791 closed patch

Duplicate filenames in database not removed by VideoManager — at Initial Version

Reported by: arniemisfeldt@… Owned by: Anduin Withers
Priority: minor Milestone: unknown
Component: mythvideo Version: 0.20
Severity: low Keywords:
Cc: Ticket locked: no

Description

I don't know how the duplicate files ended up in the database, but the VideoManager? would not delete them from the database when they were removed from the file system.

VideoScanner::verifyFiles in mythvideo/mythvideo/videoscan.cpp would mark the file for removal the first time through the for loop. The second time through the for loop, the file would get removed from the 'removal list'.

This patch checks that the file is a real file and not one marked for removal.

--- videoscan.cpp-orig 2006-12-10 19:06:21.854341471 -0800 +++ videoscan.cpp 2006-12-10 19:06:32.522173552 -0800 @@ -136,8 +136,14 @@

{

if ((iter = m_VideoFiles.find(name)) != m_VideoFiles.end()) {

  • If it's both on disk and in the database we're done with it.
  • m_VideoFiles.remove(iter);

+ In case there are duplicate files in the database, check if + this is a real file and not one that was marked for + removal. + if (*iter == kFileSystem) + { + If it's both on disk and in the database we're done with it. + m_VideoFiles.remove(iter); + }

} else {

Thanks, Arnie

Change History (0)

Note: See TracTickets for help on using tickets.