- June 25, 2015
- 566
- 292
- Home Country
- United Kingdom
I believe that the design for VideoDatabaseV5 originated in the Kodi design for a similar database. Somewhere down the line the MP design departed from the original design and, I think, there is a problem with the MP design. I have been a user of MP1 since 1.11 and have had issues with this database on several occasions owing to this flaw.
Here is an entity diagram of the MP design:
View attachment VideoDatabaseV5 - now.jpg
Here is an entity diagram of what I think is the fix and is, in essence, the same as the Kodi design:
View attachment VideoDatabaseV5 - proposed.jpg
The MP design has movie linked to path and files linked to path and movie. But, because there is a movie record for every files record, idFile and idMovie in the files table should always have the same value. However, when the data becomes corrupted, these values start to differ and the database becomes unusable. As I say, this has happened to me often over the years and the only solution is to start with a fresh VideoDatabaseV5 file, losing everything. Furthermore, I can't understand why movie would come between path and files when strPath and strFilename are clearly meant to be linked.
I am suggesting that a change to the second design would eradicate this problem completely.
Under the MP design there is another problem. The vast majority of files are usually not movies, but a movie record has to be written for every files record, even when the files record is not a movie. Wouldn't is be better to only write movie records when the files record is a movie. I believe that the second design can handle that as well.
I recognize that this is not trivial and would require a significant change but I think it would result in a more stable, and more logical, system.
Tony
Here is an entity diagram of the MP design:
View attachment VideoDatabaseV5 - now.jpg
Here is an entity diagram of what I think is the fix and is, in essence, the same as the Kodi design:
View attachment VideoDatabaseV5 - proposed.jpg
The MP design has movie linked to path and files linked to path and movie. But, because there is a movie record for every files record, idFile and idMovie in the files table should always have the same value. However, when the data becomes corrupted, these values start to differ and the database becomes unusable. As I say, this has happened to me often over the years and the only solution is to start with a fresh VideoDatabaseV5 file, losing everything. Furthermore, I can't understand why movie would come between path and files when strPath and strFilename are clearly meant to be linked.
I am suggesting that a change to the second design would eradicate this problem completely.
Under the MP design there is another problem. The vast majority of files are usually not movies, but a movie record has to be written for every files record, even when the files record is not a movie. Wouldn't is be better to only write movie records when the files record is a movie. I believe that the second design can handle that as well.
I recognize that this is not trivial and would require a significant change but I think it would result in a more stable, and more logical, system.
Tony