@@ -811,7 +811,12 @@ class Library {
811811 if ( document . getElementById ( "includeInReadingListCheckbox" ) . checked != true ) {
812812 document . getElementById ( "includeInReadingListCheckbox" ) . click ( ) ;
813813 }
814- await main . fetchContentAndPackEpub . call ( obj ) ;
814+ try {
815+ await main . fetchContentAndPackEpub . call ( obj ) ;
816+ } catch {
817+ //
818+ }
819+ Library . LibClearFields ( ) ;
815820 }
816821
817822 static LibSearchNewChapter ( objbtn ) {
@@ -846,18 +851,12 @@ class Library {
846851 }
847852
848853 static LibClearFields ( ) {
849- let chapterUrlsUI = new ChapterUrlsUI ( ) ;
850- chapterUrlsUI . populateChapterUrlsTable ( [ ] ) ;
851- let ElementsToClear = [ "titleInput" , "authorInput" , "languageInput" , "fileNameInput" , "coverImageUrlInput" , "subjectInput" , "descriptionInput" ] ;
852- for ( const element of ElementsToClear ) {
853- document . getElementById ( element ) . value = "" ;
854- }
855- document . getElementById ( "sampleCoverImg" ) . src = "" ;
854+ main . resetUI ( ) ;
856855 }
857856
858857 static async Libupdateall ( ) {
859858 if ( document . getElementById ( "LibDownloadEpubAfterUpdateCheckbox" ) . checked == true ) {
860- document . getElementById ( "includeInReadingListCheckbox " ) . click ( ) ;
859+ document . getElementById ( "LibDownloadEpubAfterUpdateCheckbox " ) . click ( ) ;
861860 }
862861 let LibArray = await Library . LibGetFromStorage ( "LibArray" ) ;
863862 ErrorLog . SuppressErrorLog = true ;
@@ -869,11 +868,13 @@ class Library {
869868 obj . dataset . libsuppressErrorLog = true ;
870869 document . getElementById ( "startingUrlInput" ) . value = await Library . LibGetFromStorage ( "LibStoryURL" + LibArray [ i ] ) ;
871870 await main . onLoadAndAnalyseButtonClick . call ( obj ) ;
872- if ( document . getElementById ( "includeInReadingListCheckbox" ) . checked != true ) {
873- document . getElementById ( "includeInReadingListCheckbox" ) . click ( ) ;
871+ try {
872+ await main . fetchContentAndPackEpub . call ( obj ) ;
873+ } catch {
874+ //
874875 }
875- await main . fetchContentAndPackEpub . call ( obj ) ;
876876 }
877+ Library . LibClearFields ( ) ;
877878 ErrorLog . SuppressErrorLog = false ;
878879 }
879880
@@ -886,7 +887,7 @@ class Library {
886887
887888 static async LibAddListToLibrary ( ) {
888889 if ( document . getElementById ( "LibDownloadEpubAfterUpdateCheckbox" ) . checked == true ) {
889- document . getElementById ( "includeInReadingListCheckbox " ) . click ( ) ;
890+ document . getElementById ( "LibDownloadEpubAfterUpdateCheckbox " ) . click ( ) ;
890891 }
891892 let links = Library . getURLsFromList ( ) ;
892893 ErrorLog . SuppressErrorLog = true ;
@@ -901,8 +902,13 @@ class Library {
901902 if ( document . getElementById ( "includeInReadingListCheckbox" ) . checked != true ) {
902903 document . getElementById ( "includeInReadingListCheckbox" ) . click ( ) ;
903904 }
904- await main . fetchContentAndPackEpub . call ( obj ) ;
905+ try {
906+ await main . fetchContentAndPackEpub . call ( obj ) ;
907+ } catch {
908+ //
909+ }
905910 }
911+ Library . LibClearFields ( ) ;
906912 ErrorLog . SuppressErrorLog = false ;
907913 }
908914
0 commit comments