ochurlaud / macaw-movies

Movie collection manager, for movie lovers. Qt/C++/Sqlite |
GNU General Public License v3.0
26 stars 4 forks source link

path lenght in the DB #102

Closed SebastienTouze closed 9 years ago

SebastienTouze commented 9 years ago

Currently the size of paths information are VARCHAR(255) in the database. For MS Windows the total path size have a maximum of 260 byte long so I think it is OK, but on Linux EACH file or directory have a name with a max length of 255 bytes. This could be a problem... Do we need to change this ?

A possibility would be for example for file_path to only contain the end of the path and a pointer to a path in path_list saved with the movie. For example: if I've got a movie in /home/sebastien/movies/movies I like/great movie.avi I import the whole "/home/sebastien/movies" folder in the settings. We just need to save this path id + "movies I like/great movie.avi" in the db to find the movie.

Have you any opinion on that @ochurlaud ?

ochurlaud commented 9 years ago

Agreed. For 0.2.0 ;)

Another problem in windows: if you remove a hard disk and add it again, you're not sure that the letter will be the same.... i think that it can be treated in the same time.

ochurlaud commented 9 years ago

@sebtouze : you do it ?

In the same time you should begin a transition code (for the database): the way to do it with sqlite is rather stupid: create a new database, call it database_new.sqlite, copy all data from the old one to the new one, then delete the old one and rename database_new.sqlite

SebastienTouze commented 9 years ago

Yes agreed. I will start to increment the DB_VERSION constant to follow up this.

ochurlaud commented 9 years ago

I'll do it

ochurlaud commented 9 years ago

I'm almost done... Just to see how i save / upgrade / hydrate the movies with this

ochurlaud commented 9 years ago

Done with acde07a2a57153d4397b6c2e19c590395dee1057