- Posts: 42
- Thank you received: 8
Refresh edited files in library
- Qulox
-
- Offline
- Senior Member
-
Please Log in or Create an account to join the conversation.
- Drybonz
- Topic Author
- Offline
- Premium Member
-
- Posts: 82
- Thank you received: 3
selmf wrote: If the last write is more recent we do a refresh of the file.
Thanks for taking a look into this. I think it's definitely going to be a good thing for the program if the library refreshes to reflect any changes in the books and folders.
Please Log in or Create an account to join the conversation.
- selmf
- Offline
- Moderator
-
- Posts: 639
- Thank you received: 136
Btw, I'd like to thank you and the other users on the forum very much for being so thorough in reporting bugs. While we've been having a hard time hunting down some of these (and even had competitive debug sessions
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Please Log in or Create an account to join the conversation.
- Drybonz
- Topic Author
- Offline
- Premium Member
-
- Posts: 82
- Thank you received: 3
Please Log in or Create an account to join the conversation.
- selmf
- Offline
- Moderator
-
- Posts: 639
- Thank you received: 136
Looks like a real YACReadian Knot.
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Please Log in or Create an account to join the conversation.
- Drybonz
- Topic Author
- Offline
- Premium Member
-
- Posts: 82
- Thank you received: 3
selmf wrote: As I feared the hash problem is only one part of the puzzle. The whole update process is actually quite complex and will require more work.
>_<
Sorry, man...
Please Log in or Create an account to join the conversation.
- selmf
- Offline
- Moderator
-
- Posts: 639
- Thank you received: 136
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Please Log in or Create an account to join the conversation.
- Luis Ángel
-
- Offline
- Administrator
-
- Posts: 3354
- Thank you received: 692
Obviously, this mechanism is very easy to break. But we aren't talking about security here, just performance.
I am not sure that the hash has something to do with folders not being updated properly. Real folders are compared with the folders in the data base, no hash implied.
Contribute to the project becoming a patron: www.patreon.com/yacreader
You can also donate via Pay-Pal: www.paypal.com/donate?business=5TAMNQCDD...e=Support+YACReader\
Please Log in or Create an account to join the conversation.
- selmf
- Offline
- Moderator
-
- Posts: 639
- Thank you received: 136
The problem I see with the library code is that it deals with a lot of cases of match/mismatch between the directories and the cached database, but it does not take the modification times of files and directories into account. Also, because every corner case of match/mismatch has to be taken into account the function is quite complicated. Now, there are two ways to go on from this point and both are equally "dangerous":
1. "Fix" the function: will add more complexity to it and invite a whole lot of more bugs. It might even not be possible to do this at all. However, if it succeeds, you still have the old proven codebase.
2. Rewrite the function: has all the problems new code usually has - you get untested, possibly buggy code but if it's done well you also get the advantages new code
Personally, I'd go for the rewrite just to make this function more manageable. Don't get me wrong, the update function is a nice work of coding and makes good use of recursion with some interesting coding concepts. However, my gut feeling tells me it is doing things the "hard way" and we should think about how to achieve the same result the "easy" way.
I even have a rough idea on how this could be done. Qt has some nice features related to QLists and Filesystems which the code does not fully take advantage of, so there's some room for improvement. Fixing the whole issue might need some adjustments to the database to add the timestamps needed for actuality checks though.
The question remaining for me right now is how grave Luis considers these refreshing bugs. If it's a blocker it might be worth the risk of a rewrite, if it's not a blocker I'll postpone working on it for the release after 8.0.0
My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Please Log in or Create an account to join the conversation.
- Luis Ángel
-
- Offline
- Administrator
-
- Posts: 3354
- Thank you received: 692
At the end of the function for updating there is a TODO task (in spanish sorry, and some old code commented). So this issue has been always identified from the first version of YACReaderLibrary. Even if we check dates, the code can be tricked easily changing the system clock (this could cause a big mess, and force a full update of the library). But it probably is the only way to go.
I have said a lot of times that I don't like the idea of modifying comic files, so I have never prioritized this. Although I understand that it should be fixed.
I dropped a feature for forcing a full refresh of the selected files from the next release, lack of time. Maybe in 8.1....
There are other bug in this topic, the issue with the folders. I fixed a similar issue years ago in the old update code (when sqlite wan't used), maybe I introduced a regression...
Contribute to the project becoming a patron: www.patreon.com/yacreader
You can also donate via Pay-Pal: www.paypal.com/donate?business=5TAMNQCDD...e=Support+YACReader\
Please Log in or Create an account to join the conversation.