Skip to content
YACReader
Help and support for Windows users.

Refresh edited files in library

More
11 years 6 months ago #1201 by Qulox
Replied by Qulox on topic Refresh edited files in library
That would be great.

Please Log in or Create an account to join the conversation.

  • Drybonz
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
11 years 6 months ago #1202 by Drybonz
Replied by Drybonz on topic Refresh edited files in library

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.

More
11 years 6 months ago #1203 by selmf
Replied by selmf on topic Refresh edited files in library
I'll try to fix this till the next beta but I can't promise anything. Sometimes seemingly small changes tend to cause big problems and you end up having to rewrite major parts of the code. So, until I ran some tests and know how deep the rabbit hole goes it's hard to tell how much work this is gonna be.

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 :cheer: ) we've been able to fix some deeply rooted nasty bugs that have gone unnoticed for multiple releases.

My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
The following user(s) said Thank You: Drybonz

Please Log in or Create an account to join the conversation.

  • Drybonz
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
11 years 6 months ago #1204 by Drybonz
Replied by Drybonz on topic Refresh edited files in library
Thanks, while I have used many different readers over the years, I'm new to YACReader, but when I see you guys working on this stuff and so active on the forums I really have very high hopes for this program. I'm already using it pretty regularly and have recommended it to other people.

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago - 11 years 6 months ago #1205 by selmf
Replied by selmf on topic Refresh edited files in library
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.

Looks like a real YACReadian Knot. :'(

My answers are not necessarily official YACReader statements but mostly represent my own opinion in technical matters.
Last edit: 11 years 6 months ago by selmf.

Please Log in or Create an account to join the conversation.

  • Drybonz
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
11 years 6 months ago #1206 by Drybonz
Replied by Drybonz on topic Refresh edited files in library

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.

More
11 years 6 months ago #1207 by selmf
Replied by selmf on topic Refresh edited files in library
It happens. I had a similiar experience with the double page mode. In such cases it often is the best solution to start from scratch again, i.e instead of adding more complexity to try to rewrite the function in a simpler and cleaner way. However, we're deep in the beta so this is a risk I'm not sure Luis is willing to take ;)

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.

More
11 years 6 months ago #1213 by Luis Ángel
Replied by Luis Ángel on topic Refresh edited files in library
The current hash calculation can cause some collisions, it uses the first 0.5MB but it also adds the files size to the end of the hash. So most of files changes are detected.

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.

More
11 years 6 months ago #1215 by selmf
Replied by selmf on topic Refresh edited files in library
Yes, the hash could be a point of failure but the actual failure happens before we're getting to the part of the code where hashes are calculated and/or checked. The update code relies on filenames and directory names only.
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.

More
11 years 6 months ago #1216 by Luis Ángel
Replied by Luis Ángel on topic Refresh edited files in library
I don't see it as a blocker. At this point, there are more risks than benefits for trying to rewrite the update code for 8.0.

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.

Moderators: Luis Ángel
Powered by Kunena Forum

Thanks for downloading YACReader!

Your download is starting.

YACReader for iOS and Android

Connect to YACReaderLibrary to browse, read remotely and import comics. Your reading progress is synchronized across devices.

Download on the App Store Get it on Google Play Available at Amazon Appstore

Discover all the features on the iOS and Android pages, and learn how to use them in the iOS and Android user guides.

Support YACReader

YACReader for desktop and server is free to use, but it is not free to develop: maintaining this website, developer programs, code signing certificates, test devices and, of course, all the time it takes. Less than 0.01% of downloads end in a donation, so any amount counts.

By supporting the project you help keep it regularly updated and, most importantly, alive. Thanks!