weto91 / kindle-cover-fixer

Fix your e-book covers in your Kindle device
GNU General Public License v3.0
22 stars 4 forks source link

Forced Closing #16

Open Cruzan80 opened 9 months ago

Cruzan80 commented 9 months ago

When I load the program, it force closes almost immediately. It does not matter if the Kindle is plugged in or not. Kindle Scribe, Windows 10.

weto91 commented 9 months ago

Hello, have you installed Calibre with any Calibre library and books in it?

Cruzan80 commented 9 months ago

Yes, Calibre was open at the time. Several thousand books in it. Located on a NAS (mapped network drive).

On Sat, Dec 9, 2023, 1:25 PM Álvaro Rubio @.***> wrote:

Hello, have you installed Calibre with any Calibre library and books in it?

— Reply to this email directly, view it on GitHub https://github.com/weto91/kindle-cover-fixer/issues/16#issuecomment-1848672255, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWMAADJ36F5G4UAFP3NCMMDYITCKDAVCNFSM6AAAAABAOAE7IGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBYGY3TEMRVGU . You are receiving this because you authored the thread.Message ID: @.***>

weto91 commented 9 months ago

Okey, maybe thats the problem. The application does not manage network mappings... So you must transfer the library to one of the local partitions to run this application...

Regards.

Cruzan80 commented 9 months ago

I will try that. Currently, I have it mapped to show up as a standard drive letter, so it "should" see it the same as another physical drive. Will the app handle Libraries other than in C:?

On Sat, Dec 9, 2023, 2:21 PM Álvaro Rubio @.***> wrote:

Okey, maybe thats the problem. The application does not manage network mappings... So you must transfer the library to one of the local partitions to run this application...

Regards.

— Reply to this email directly, view it on GitHub https://github.com/weto91/kindle-cover-fixer/issues/16#issuecomment-1848687113, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWMAADLNLQ6642HYPACKP2TYITI4NAVCNFSM6AAAAABAOAE7IGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBYGY4DOMJRGM . You are receiving this because you authored the thread.Message ID: @.***>

weto91 commented 9 months ago

No, if is mapped with drive letter, thats not the problem. Can you attach :%APPDATA%/Calibre/gui.json file? in this file, are listed all Calibre libraries, That way I see how it is exposed and we start looking for the problem from there.

Thanks.

Cruzan80 commented 9 months ago

Sorry for the delay. I was incorrect, it wasn't mapped to a drive for that instance. I made a "test" library on an internal D: drive, and transferred some files to it. The program was able to work eventually, but kept crashing at random times. Using the clear tools (both Calibre and Kindle) seemed to help, as well as not having Calibre open helped as well. Sometimes it would crash when scanning the titles, sometimes when generating covers. Is there a practical field limit? The "test" library had a few hundred files. No real specific instance of when it would crash, sometimes immediately, sometimes in the middle of a scan or generating covers.

On Sun, Dec 10, 2023, 3:46 AM Álvaro Rubio @.***> wrote:

No, if is mapped with drive letter, thats not the problem. Can you attach :%APPDATA%/Calibre/gui.json file? in this file, are listed all Calibre libraries, That way I see how it is exposed and we start looking for the problem from there.

Thanks.

— Reply to this email directly, view it on GitHub https://github.com/weto91/kindle-cover-fixer/issues/16#issuecomment-1848926739, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWMAADOEYMNPHYISKTCO33TYIWHGRAVCNFSM6AAAAABAOAE7IGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBYHEZDMNZTHE . You are receiving this because you authored the thread.Message ID: @.***>

weto91 commented 9 months ago

If you have titles with strange symbols, it is possible that the application could crash. During development, tests were carried out with a wide variety of titles, but it is possible that there is a title that contains a symbol that we have not handled and fails.

In principle, it doesn't matter how long the title is, if caliber allows a length, so does this application.

If it fails again, send me the application log file and we can try to figure out what's happening (%APPDATA%/Kindle Cover Fixer/*.log)

Thank you.

SlowWap commented 6 months ago

Fixed by adding a 'connection.open' test in the Libraries.cs file. Test is valid database can be opened (mapped drive, network URL, etc...). Quick and dirty code so expection is not thrown in ImageCover.cs...

//test if library can be opened try { // string data = string.Empty; string cs = @"URI=file:" + library + @"\metadata.db"; using SQLiteConnection connection = new(cs); connection.Open(); // connection.Close();

//Add library to list
if (!library.Contains("[ERROR]"))
{
    libraryPath.Items.Add(library);
}
else
{
    DisableControl(findBooks);
    DisableControl(generateButton);
    MessageBox.Show(Strings.CheckLibrary, Strings.CheckLibraryTitle, MessageBoxButton.OK, MessageBoxImage.Error);
}
LogLine("LIBRARY", "Library: " + library + " loaded.");

} catch (Exception) { //don't add lib to list ; }

SlowWap commented 6 months ago

Also need a busy wait on... CheckKindleType() timed event, so that is does not fire when in FindBookTasks or TransferFilesToKindle because MTP devices will throw an exception if busy doing file transfer while an enumeration is attempted.