From: Niki Roo Date: Thu, 19 Sep 2019 19:28:22 +0000 (+0200) Subject: Merge branch 'master' of github.com:nikiroo/fanfix X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=64a8f5241629dfb688c109a2d8f29dbd3c80a1d3;hp=c86a4bce83fb887bc3b202be6065c5dad4bdcc64;p=nikiroo-utils.git Merge branch 'master' of github.com:nikiroo/fanfix --- diff --git a/README-fr.md b/README-fr.md index 5a0d7f8..777840a 100644 --- a/README-fr.md +++ b/README-fr.md @@ -120,6 +120,20 @@ Quelques tests unitaires sont disponibles : ```./configure.sh && make build test run-test``` +Si vous faites tourner les tests unitaires, sachez que certains fichiers flags peuvent les impacter: + +- ```test/VERBOSE``` : active le mode verbeux pour les erreurs +- ```test/OFFLINE``` : ne permet pas au programme de télécharger des données +- ```test/URLS``` : permet au programme de tester des URLs +- ```test/FORCE_REFRESH```: force le nettoyage du cache + +Notez que le répertoire ```test/CACHE``` peut rester en place; il contient tous les fichiers téléchargés au moins une fois depuis le réseau par les tests unitaires (si vous autorisez les tests d'URLs, lancez les tests au moins une fois pour peupler le CACHE, puis activez le mode OFFLINE, ça marchera toujours). + +Les fichiers de test seront: + +- ```test/*.url``` : des URLs à télécharger en fichier texte (le contenu du fichier est l'URL) +- ```test/*.story```: des histoires en mode texte (le contenu du fichier est l'histoire) + ### Librairies dépendantes (incluses) Nécessaires : diff --git a/README.md b/README.md index 7e7c3b9..43a0f40 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,21 @@ There are some unit tests you can run, too: ```./configure.sh && make build test run-test``` +If you run the unit tests, note that some flag files can impact them: + +- ```test/VERBOSE``` : enable verbose mode +- ```test/OFFLINE``` : to forbid any downloading +- ```test/URLS``` : to allow testing URLs +- ```test/FORCE_REFRESH```: to force a clear of the cache + +Note that ```test/CACHE``` can be kept, as it will contain all internet related files you need (if you allow URLs, run the test once which will populate the CACHE then go OFFLINE, it will still work). + +The test files will be: + +- ```test/*.url``` : URL to download in text format, content = URL +- ```test/*.story```: text mode story, content = story + + ### Dependant libraries (included) Required: diff --git a/TODO.md b/TODO.md index f9f7692..af17b53 100644 --- a/TODO.md +++ b/TODO.md @@ -85,10 +85,10 @@ My current planning for Fanfix (but not everything appears on this list): - [ ] Add the resume in the Properties page (maybe a second tab?) - [ ] Bugs - [x] Fix "Redownload also reset the source" - - [ ] Fix "Redownload remote does not show the new item before restart of client app" + - [x] Fix "Redownload remote does not show the new item before restart of client app" - [x] Fix eHentai "content warning" access (see 455) - [ ] Fix the configuration system (for new or changed options, new or changed languages) - - [ ] remote import also download the file in cache, why? + - [x] remote import also download the file in cache, why? - [x] import file in remote mode tries to import remote file!! - [ ] import file does not find author in cbz with SUMMARY file - [x] import file:// creates a tmp without auto-deletion in /tmp/fanfic-... diff --git a/changelog-fr.md b/changelog-fr.md index 5ea8c32..d242cab 100644 --- a/changelog-fr.md +++ b/changelog-fr.md @@ -7,10 +7,12 @@ - new: support d'un proxy - fix: support des CBZ contenant du texte - fix: correction de DEBUG=0 +- fix: correction des histoires importées qui n'arrivent pas immédiatement à l'affichage - gui: correction pour le focus - gui: fix pour la couleur d'arrière plan - gui: fix pour la navigation au clavier (haut et bas) - gui: configuration beaucoup plus facile +- gui: peut maintenant télécharger toutes les histoires d'un groupe en cache en une fois - MangaLEL: site web changé - search: supporte MangaLEL - search: supporte Fanfiction.net diff --git a/changelog.md b/changelog.md index 195310b..5173c25 100644 --- a/changelog.md +++ b/changelog.md @@ -7,10 +7,12 @@ - new: proxy support - fix: support hybrid CBZ (with text) - fix: fix DEBUG=0 +- fix: fix imported stories that don't immediatly appear on screen - gui: focus fix - gui: bg colour fix - gui: fix keyboard navigation support (up and down) - gui: configuration is now much easier +- gui: can now prefetch to cache all the sories of a group at once - MangaLEL: website has changed - search: Fanfiction.net support - search: MangaLEL support diff --git a/libs/nikiroo-utils-5.0.0-dev-sources.jar b/libs/nikiroo-utils-5.0.0-dev-sources.jar index 3a29484..9f0b4a0 100644 Binary files a/libs/nikiroo-utils-5.0.0-dev-sources.jar and b/libs/nikiroo-utils-5.0.0-dev-sources.jar differ diff --git a/src/be/nikiroo/fanfix/Main.java b/src/be/nikiroo/fanfix/Main.java index b363361..3d69cad 100644 --- a/src/be/nikiroo/fanfix/Main.java +++ b/src/be/nikiroo/fanfix/Main.java @@ -12,6 +12,7 @@ import javax.net.ssl.SSLException; import be.nikiroo.fanfix.bundles.Config; import be.nikiroo.fanfix.bundles.StringId; import be.nikiroo.fanfix.data.Chapter; +import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Story; import be.nikiroo.fanfix.library.BasicLibrary; import be.nikiroo.fanfix.library.CacheLibrary; @@ -644,10 +645,10 @@ public class Main { */ public static int imprt(String urlString, Progress pg) { try { - Story story = Instance.getLibrary().imprt( + MetaData meta = Instance.getLibrary().imprt( BasicReader.getUrl(urlString), pg); - System.out.println(story.getMeta().getLuid() + ": \"" - + story.getMeta().getTitle() + "\" imported."); + System.out.println(meta.getLuid() + ": \"" + meta.getTitle() + + "\" imported."); } catch (IOException e) { Instance.getTraceHandler().error(e); return 1; diff --git a/src/be/nikiroo/fanfix/bundles/StringIdGui.java b/src/be/nikiroo/fanfix/bundles/StringIdGui.java index 6bb774c..2c9d222 100644 --- a/src/be/nikiroo/fanfix/bundles/StringIdGui.java +++ b/src/be/nikiroo/fanfix/bundles/StringIdGui.java @@ -109,6 +109,8 @@ public enum StringIdGui { MENU_FILE_OPEN, // @Meta(def = "Edit", format = Format.STRING, description = "the edit menu") MENU_EDIT, // + @Meta(def = "Download to cache", format = Format.STRING, description = "the edit/send to cache menu button, to download the story into the cache if not already done") + MENU_EDIT_DOWNLOAD_TO_CACHE, // @Meta(def = "Clear cache", format = Format.STRING, description = "the clear cache menu button, to clear the cache for a single book") MENU_EDIT_CLEAR_CACHE, // @Meta(def = "Redownload", format = Format.STRING, description = "the edit/redownload menu button, to download the latest version of the book") diff --git a/src/be/nikiroo/fanfix/bundles/resources_core.properties b/src/be/nikiroo/fanfix/bundles/resources_core.properties index 1ebc3d5..d656ed6 100644 --- a/src/be/nikiroo/fanfix/bundles/resources_core.properties +++ b/src/be/nikiroo/fanfix/bundles/resources_core.properties @@ -1,4 +1,4 @@ -# United Kingdom (en_GB) resources translation file (UTF-8) +# United Kingdom (en_GB) resources_core translation file (UTF-8) # # Note that any key can be doubled with a _NOUTF suffix # to use when the NOUTF env variable is set to 1 @@ -8,7 +8,7 @@ # help message for the syntax -# (FORMAT: STRING) %s = supported input, %s = supported output +# (FORMAT: STRING) HELP_SYNTAX = Valid options:\n\ \t--import [URL]: import into library\n\ \t--export [id] [output_type] [target]: export story to target\n\ @@ -48,52 +48,53 @@ Supported input types:\n\ \n\ Supported output types:\n\ %s -# syntax error message (FORMAT: STRING) +# syntax error message +# (FORMAT: STRING) ERR_SYNTAX = Syntax error (try "--help") # an input or output support type description -# (FORMAT: STRING) %s = support name, %s = support desc +# (FORMAT: STRING) ERR_SYNTAX_TYPE = > %s: %s # Error when retrieving data -# (FORMAT: STRING) %s = input string +# (FORMAT: STRING) ERR_LOADING = Error when retrieving data from: %s # Error when saving to given target -# (FORMAT: STRING) %s = save target +# (FORMAT: STRING) ERR_SAVING = Error when saving to target: %s # Error when unknown output format -# (FORMAT: STRING) %s = bad output format +# (FORMAT: STRING) ERR_BAD_OUTPUT_TYPE = Unknown output type: %s # Error when converting input to URL/File -# (FORMAT: STRING) %s = input string +# (FORMAT: STRING) ERR_BAD_URL = Cannot understand file or protocol: %s # URL/File not supported -# (FORMAT: STRING) %s = input url +# (FORMAT: STRING) ERR_NOT_SUPPORTED = URL not supported: %s # Failed to download cover : %s -# (FORMAT: STRING) %s = cover URL +# (FORMAT: STRING) ERR_BS_NO_COVER = Failed to download cover: %s # Canonical OPEN SINGLE QUOTE char (for instance: ‘) -# (FORMAT: STRING) single char +# (FORMAT: STRING) OPEN_SINGLE_QUOTE = ‘ # Canonical CLOSE SINGLE QUOTE char (for instance: ’) -# (FORMAT: STRING) single char +# (FORMAT: STRING) CLOSE_SINGLE_QUOTE = ’ # Canonical OPEN DOUBLE QUOTE char (for instance: “) -# (FORMAT: STRING) single char +# (FORMAT: STRING) OPEN_DOUBLE_QUOTE = “ # Canonical CLOSE DOUBLE QUOTE char (for instance: ”) -# (FORMAT: STRING) single char +# (FORMAT: STRING) CLOSE_DOUBLE_QUOTE = ” # Name of the description fake chapter # (FORMAT: STRING) DESCRIPTION = Description # Name of a chapter with a name -# (FORMAT: STRING) %d = number, %s = name +# (FORMAT: STRING) CHAPTER_NAMED = Chapter %d: %s # Name of a chapter without name -# (FORMAT: STRING) %d = number, %s = name +# (FORMAT: STRING) CHAPTER_UNNAMED = Chapter %d # Default description when the type is not known by i18n -# (FORMAT: STRING) %s = type +# (FORMAT: STRING) INPUT_DESC = Unknown type: %s # Description of this input type # (FORMAT: STRING) @@ -142,7 +143,7 @@ INPUT_DESC_CBZ = CBZ files coming from this very program # (FORMAT: STRING) INPUT_DESC_HTML = HTML files coming from this very program # Default description when the type is not known by i18n -# (FORMAT: STRING) %s = type +# (FORMAT: STRING) OUTPUT_DESC = Unknown type: %s # Description of this output type # (FORMAT: STRING) @@ -177,7 +178,7 @@ OUTPUT_DESC_LATEX = A LaTeX file using the "book" template # (FORMAT: STRING) OUTPUT_DESC_SYSOUT = A simple DEBUG console output # Default description when the type is not known by i18n -#This item is used as a group, its content is not expected to be used. +# This item is used as a group, its content is not expected to be used. OUTPUT_DESC_SHORT = %s # Short description of this output type # (FORMAT: STRING) @@ -201,7 +202,7 @@ OUTPUT_DESC_SHORT_SYSOUT = Console output # (FORMAT: STRING) OUTPUT_DESC_SHORT_HTML = HTML files with resources (directory, .html) # Error message for unknown 2-letter LaTeX language code -# (FORMAT: STRING) %s = the unknown 2-code language +# (FORMAT: STRING) LATEX_LANG_UNKNOWN = Unknown language: %s # 'by' prefix before author name used to output the author, make sure it is covered by Config.BYS for input detection # (FORMAT: STRING) diff --git a/src/be/nikiroo/fanfix/bundles/resources_core_fr.properties b/src/be/nikiroo/fanfix/bundles/resources_core_fr.properties index e64651b..9bf3626 100644 --- a/src/be/nikiroo/fanfix/bundles/resources_core_fr.properties +++ b/src/be/nikiroo/fanfix/bundles/resources_core_fr.properties @@ -1,4 +1,4 @@ -# français (fr) resources translation file (UTF-8) +# français (fr) resources_core translation file (UTF-8) # # Note that any key can be doubled with a _NOUTF suffix # to use when the NOUTF env variable is set to 1 @@ -8,7 +8,7 @@ # help message for the syntax -# (FORMAT: STRING) %s = supported input, %s = supported output +# (FORMAT: STRING) HELP_SYNTAX = Options reconnues :\n\ \t--import [URL]: importer une histoire dans la librairie\n\ \t--export [id] [output_type] [target]: exporter l'histoire "id" vers le fichier donné\n\ @@ -39,52 +39,53 @@ Types supportés en entrée :\n\ \n\ Types supportés en sortie :\n\ %s -# syntax error message (FORMAT: STRING) +# syntax error message +# (FORMAT: STRING) ERR_SYNTAX = Erreur de syntaxe (essayez "--help") # an input or output support type description -# (FORMAT: STRING) %s = support name, %s = support desc +# (FORMAT: STRING) ERR_SYNTAX_TYPE = > %s : %s # Error when retrieving data -# (FORMAT: STRING) %s = input string +# (FORMAT: STRING) ERR_LOADING = Erreur de récupération des données depuis : %s # Error when saving to given target -# (FORMAT: STRING) %s = save target +# (FORMAT: STRING) ERR_SAVING = Erreur lors de la sauvegarde sur : %s # Error when unknown output format -# (FORMAT: STRING) %s = bad output format +# (FORMAT: STRING) ERR_BAD_OUTPUT_TYPE = Type de sortie inconnu : %s # Error when converting input to URL/File -# (FORMAT: STRING) %s = input string +# (FORMAT: STRING) ERR_BAD_URL = Protocole ou type de fichier inconnu : %s # URL/File not supported -# (FORMAT: STRING) %s = input url +# (FORMAT: STRING) ERR_NOT_SUPPORTED = Site web non supporté : %s # Failed to download cover : %s -# (FORMAT: STRING) %s = cover URL +# (FORMAT: STRING) ERR_BS_NO_COVER = Échec de la récupération de la page de couverture : %s # Canonical OPEN SINGLE QUOTE char (for instance: ‘) -# (FORMAT: STRING) single char +# (FORMAT: STRING) OPEN_SINGLE_QUOTE = ‘ # Canonical CLOSE SINGLE QUOTE char (for instance: ’) -# (FORMAT: STRING) single char +# (FORMAT: STRING) CLOSE_SINGLE_QUOTE = ’ # Canonical OPEN DOUBLE QUOTE char (for instance: “) -# (FORMAT: STRING) single char +# (FORMAT: STRING) OPEN_DOUBLE_QUOTE = “ # Canonical CLOSE DOUBLE QUOTE char (for instance: ”) -# (FORMAT: STRING) single char +# (FORMAT: STRING) CLOSE_DOUBLE_QUOTE = ” # Name of the description fake chapter # (FORMAT: STRING) DESCRIPTION = Description # Name of a chapter with a name -# (FORMAT: STRING) %d = number, %s = name +# (FORMAT: STRING) CHAPTER_NAMED = Chapitre %d : %s # Name of a chapter without name -# (FORMAT: STRING) %d = number, %s = name +# (FORMAT: STRING) CHAPTER_UNNAMED = Chapitre %d # Default description when the type is not known by i18n -# (FORMAT: STRING) %s = type +# (FORMAT: STRING) INPUT_DESC = Type d'entrée inconnu : %s # Description of this input type # (FORMAT: STRING) @@ -125,7 +126,7 @@ INPUT_DESC_CBZ = Les fichiers .cbz (une collection d'images zipées), de préfé # (FORMAT: STRING) INPUT_DESC_HTML = Les fichiers HTML que vous pouvez ouvrir avec n'importe quel navigateur ; remarquez que Fanfix créera un répertoire pour y mettre les fichiers nécessaires, dont un fichier "index.html" pour afficher le tout -- nous ne supportons en entrée que les fichiers HTML créés par Fanfix # Default description when the type is not known by i18n -# (FORMAT: STRING) %s = type +# (FORMAT: STRING) OUTPUT_DESC = Type de sortie inconnu : %s # Description of this output type # (FORMAT: STRING) @@ -160,7 +161,7 @@ OUTPUT_DESC_LATEX = A LaTeX file using the "book" template # (FORMAT: STRING) OUTPUT_DESC_SYSOUT = A simple DEBUG console output # Default description when the type is not known by i18n -#This item is used as a group, its content is not expected to be used. +# This item is used as a group, its content is not expected to be used. OUTPUT_DESC_SHORT = %s # Short description of this output type # (FORMAT: STRING) @@ -184,7 +185,7 @@ OUTPUT_DESC_SHORT_SYSOUT = Console output # (FORMAT: STRING) OUTPUT_DESC_SHORT_HTML = HTML files with resources (directory, .html) # Error message for unknown 2-letter LaTeX language code -# (FORMAT: STRING) %s = the unknown 2-code language +# (FORMAT: STRING) LATEX_LANG_UNKNOWN = Unknown language: %s # 'by' prefix before author name used to output the author, make sure it is covered by Config.BYS for input detection # (FORMAT: STRING) diff --git a/src/be/nikiroo/fanfix/bundles/resources_gui.properties b/src/be/nikiroo/fanfix/bundles/resources_gui.properties index de44c18..6d46af4 100644 --- a/src/be/nikiroo/fanfix/bundles/resources_gui.properties +++ b/src/be/nikiroo/fanfix/bundles/resources_gui.properties @@ -1,4 +1,4 @@ -# United States (en_US) resources_gui translation file (UTF-8) +# United Kingdom (en_GB) resources_gui translation file (UTF-8) # # Note that any key can be doubled with a _NOUTF suffix # to use when the NOUTF env variable is set to 1 @@ -8,10 +8,10 @@ # the title of the main window of Fanfix, the library -# (FORMAT: STRING) %s = current Fanfix version +# (FORMAT: STRING) TITLE_LIBRARY = Fanfix %s # the title of the main window of Fanfix, the library, when the library has a name (i.e., is not local) -# (FORMAT: STRING) %s = current Fanfix version, %s = library name +# (FORMAT: STRING) TITLE_LIBRARY_WITH_NAME = Fanfix %s # the title of the configuration window of Fanfix, also the name of the menu button # (FORMAT: STRING) @@ -38,7 +38,7 @@ SUBTITLE_MOVE_TO = Move to: # (FORMAT: STRING) TITLE_DELETE = Delete story # the subtitle of the 'delete' window of Fanfix -# (FORMAT: STRING) %s = LUID of the story, %s = title of the story +# (FORMAT: STRING) SUBTITLE_DELETE = Delete %s: %s # the title of the 'library error' dialogue # (FORMAT: STRING) @@ -53,27 +53,28 @@ SUBTITLE_IMPORT_URL = URL of the story to import: # (FORMAT: STRING) TITLE_ERROR = Error # the title of a story for the properties dialogue, the viewers... -# (FORMAT: STRING) %s = LUID of the story, %s = title of the story +# (FORMAT: STRING) TITLE_STORY = %s: %s # HTML text used to notify of a new version -# (FORMAT: STRING) %s = url link in HTML +# (FORMAT: STRING) NEW_VERSION_AVAILABLE = A new version of the program is available at %s # text used as title for the update dialogue # (FORMAT: STRING) NEW_VERSION_TITLE = Updates available # HTML text used to specify a newer version title and number, used for each version newer than the current one -# (FORMAT: STRING) %s = the newer version number +# (FORMAT: STRING) NEW_VERSION_VERSION = Version %s # show the number of words of a book -# (FORMAT: STRING) %s = the number +# (FORMAT: STRING) BOOK_COUNT_WORDS = %s words # show the number of images of a book -# (FORMAT: STRING) %s = the number +# (FORMAT: STRING) BOOK_COUNT_IMAGES = %s images # show the number of stories of a meta-book (a book representing allthe types/sources or all the authors present) -# (FORMAT: STRING) %s = the number +# (FORMAT: STRING) BOOK_COUNT_STORIES = %s stories -# the file menu (FORMAT: STRING) +# the file menu +# (FORMAT: STRING) MENU_FILE = File # the file/exit menu button # (FORMAT: STRING) @@ -108,8 +109,12 @@ MENU_FILE_PROPERTIES = Properties # the file/open menu item, that will open the story or fake-story (an author or a source/type) # (FORMAT: STRING) MENU_FILE_OPEN = Open -# the edit menu (FORMAT: STRING) +# the edit menu +# (FORMAT: STRING) MENU_EDIT = Edit +# the edit/send to cache menu button, to download the story into the cache if not already done +# (FORMAT: STRING) +MENU_EDIT_DOWNLOAD_TO_CACHE = Download to cache # the clear cache menu button, to clear the cache for a single book # (FORMAT: STRING) MENU_EDIT_CLEAR_CACHE = Clear cache @@ -128,7 +133,8 @@ MENU_EDIT_SET_COVER_FOR_AUTHOR = Set as cover for author # the search menu to open the earch stories on one of the searchable websites # (FORMAT: STRING) MENU_SEARCH = Search -# the view menu (FORMAT: STRING) +# the view menu +# (FORMAT: STRING) MENU_VIEW = View # the view/word_count menu button, to show the word/image/story count as secondary info # (FORMAT: STRING) @@ -158,7 +164,7 @@ MENU_AUTHORS_UNKNOWN = [unknown] # (FORMAT: STRING) PROGRESS_OUT_OF_UI_RELOAD_BOOKS = Reload books # progress bar caption for the 'change source' step of the ReDownload operation -# (FORMAT: STRING) %s = new source name +# (FORMAT: STRING) PROGRESS_CHANGE_SOURCE = Change the source of the book to %s # default description if the error is not known # (FORMAT: STRING) @@ -176,18 +182,18 @@ ERROR_LIB_STATUS_UNAVAILABLE = Library currently unavailable # (FORMAT: STRING) ERROR_CANNOT_OPEN = Cannot open the selected book # URL is not supported by Fanfix -# (FORMAT: STRING) %s = URL +# (FORMAT: STRING) ERROR_URL_NOT_SUPPORTED = URL not supported: %s # cannot import the URL -# (FORMAT: STRING) %s = URL, %s = reasons +# (FORMAT: STRING) ERROR_URL_IMPORT_FAILED = Failed to import %s:\n\ %s # (html) the chapter progression value used on the viewers -# (FORMAT: STRING) %d = chapter number, %d = total chapters +# (FORMAT: STRING) CHAPTER_HTML_UNNAMED =   Chapter %d/%d # (html) the chapter progression value used on the viewers -# (FORMAT: STRING) %d = chapter number, %d = total chapters, %s = chapter name +# (FORMAT: STRING) CHAPTER_HTML_NAMED =   Chapter %d/%d: %s # (NO html) the chapter progression value used on the viewers -# (FORMAT: STRING) %d = current image number, %d = total images +# (FORMAT: STRING) IMAGE_PROGRESSION = Image %d / %d diff --git a/src/be/nikiroo/fanfix/bundles/resources_gui_fr.properties b/src/be/nikiroo/fanfix/bundles/resources_gui_fr.properties index 2b6d192..ee7c887 100644 --- a/src/be/nikiroo/fanfix/bundles/resources_gui_fr.properties +++ b/src/be/nikiroo/fanfix/bundles/resources_gui_fr.properties @@ -8,10 +8,10 @@ # the title of the main window of Fanfix, the library -# (FORMAT: STRING) %s = current Fanfix version +# (FORMAT: STRING) TITLE_LIBRARY = Fanfix %s # the title of the main window of Fanfix, the library, when the library has a name (i.e., is not local) -# (FORMAT: STRING) %s = current Fanfix version, %s = library name +# (FORMAT: STRING) TITLE_LIBRARY_WITH_NAME = Fanfix %s # the title of the configuration window of Fanfix, also the name of the menu button # (FORMAT: STRING) @@ -38,7 +38,7 @@ SUBTITLE_MOVE_TO = Déplacer vers : # (FORMAT: STRING) TITLE_DELETE = Supprimer le livre # the subtitle of the 'delete' window of Fanfix -# (FORMAT: STRING) %s = LUID of the story, %s = title of the story +# (FORMAT: STRING) SUBTITLE_DELETE = Supprimer %s : %s # the title of the 'library error' dialogue # (FORMAT: STRING) @@ -53,27 +53,28 @@ SUBTITLE_IMPORT_URL = L'URL du livre à importer # (FORMAT: STRING) TITLE_ERROR = Error # the title of a story for the properties dialogue, the viewers... -# (FORMAT: STRING) %s = LUID of the story, %s = title of the story +# (FORMAT: STRING) TITLE_STORY = %s: %s # HTML text used to notify of a new version -# (FORMAT: STRING) %s = url link in HTML +# (FORMAT: STRING) NEW_VERSION_AVAILABLE = Une nouvelle version du programme est disponible sur %s # text used as title for the update dialogue # (FORMAT: STRING) NEW_VERSION_TITLE = Mise-à-jour disponible # HTML text used to specify a newer version title and number, used for each version newer than the current one -# (FORMAT: STRING) %s = the newer version number +# (FORMAT: STRING) NEW_VERSION_VERSION = Version %s # show the number of words of a book -# (FORMAT: STRING) %s = the number +# (FORMAT: STRING) BOOK_COUNT_WORDS = %s mots # show the number of images of a book -# (FORMAT: STRING) %s = the number +# (FORMAT: STRING) BOOK_COUNT_IMAGES = %s images # show the number of stories of a meta-book (a book representing allthe types/sources or all the authors present) -# (FORMAT: STRING) %s = the number +# (FORMAT: STRING) BOOK_COUNT_STORIES = %s livres -# the file menu (FORMAT: STRING) +# the file menu +# (FORMAT: STRING) MENU_FILE = Fichier # the file/exit menu button # (FORMAT: STRING) @@ -108,8 +109,12 @@ MENU_FILE_PROPERTIES = Propriétés # the file/open menu item, that will open the story or fake-story (an author or a source/type) # (FORMAT: STRING) MENU_FILE_OPEN = Ouvrir -# the edit menu (FORMAT: STRING) +# the edit menu +# (FORMAT: STRING) MENU_EDIT = Edition +# the edit/send to cache menu button, to download the story into the cache if not already done +# (FORMAT: STRING) +MENU_EDIT_DOWNLOAD_TO_CACHE = Charger en cache # the clear cache menu button, to clear the cache for a single book # (FORMAT: STRING) MENU_EDIT_CLEAR_CACHE = Nettoyer le cache @@ -128,7 +133,8 @@ MENU_EDIT_SET_COVER_FOR_AUTHOR = Utiliser comme cover pour l'auteur # the search menu to open the earch stories on one of the searchable websites # (FORMAT: STRING) MENU_SEARCH = Recherche -# the view menu (FORMAT: STRING) +# the view menu +# (FORMAT: STRING) MENU_VIEW = Affichage # the view/word_count menu button, to show the word/image/story count as secondary info # (FORMAT: STRING) @@ -158,7 +164,7 @@ MENU_AUTHORS_UNKNOWN = [inconnu] # (FORMAT: STRING) PROGRESS_OUT_OF_UI_RELOAD_BOOKS = Recharger les livres # progress bar caption for the 'change source' step of the ReDownload operation -# (FORMAT: STRING) %s = new source name +# (FORMAT: STRING) PROGRESS_CHANGE_SOURCE = Change la source du livre en %s # default description if the error is not known # (FORMAT: STRING) @@ -176,18 +182,18 @@ ERROR_LIB_STATUS_UNAVAILABLE = Librairie indisponible # (FORMAT: STRING) ERROR_CANNOT_OPEN = Impossible d'ouvrir le livre sélectionné # URL is not supported by Fanfix -# (FORMAT: STRING) %s = URL +# (FORMAT: STRING) ERROR_URL_NOT_SUPPORTED = URL non supportée : %s # cannot import the URL -# (FORMAT: STRING) %s = URL, %s = reasons +# (FORMAT: STRING) ERROR_URL_IMPORT_FAILED = Erreur lors de l'import de %s:\n\ %s # (html) the chapter progression value used on the viewers -# (FORMAT: STRING) %d = chapter number, %d = total chapters +# (FORMAT: STRING) CHAPTER_HTML_UNNAMED =   Chapitre %d / %d # (html) the chapter progression value used on the viewers -# (FORMAT: STRING) %d = chapter number, %d = total chapters, %s = chapter name +# (FORMAT: STRING) CHAPTER_HTML_NAMED =   Chapitre %d / %d: %s # (NO html) the chapter progression value used on the viewers -# (FORMAT: STRING) %d = current image number, %d = total images +# (FORMAT: STRING) IMAGE_PROGRESSION = Image %d / %d diff --git a/src/be/nikiroo/fanfix/library/BasicLibrary.java b/src/be/nikiroo/fanfix/library/BasicLibrary.java index 380c5c9..099859d 100644 --- a/src/be/nikiroo/fanfix/library/BasicLibrary.java +++ b/src/be/nikiroo/fanfix/library/BasicLibrary.java @@ -751,14 +751,14 @@ abstract public class BasicLibrary { * @param pg * the optional progress reporter * - * @return the imported {@link Story} + * @return the imported Story {@link MetaData} * * @throws UnknownHostException * if the host is not supported * @throws IOException * in case of I/O error */ - public Story imprt(URL url, Progress pg) throws IOException { + public MetaData imprt(URL url, Progress pg) throws IOException { if (pg == null) pg = new Progress(); @@ -776,7 +776,7 @@ abstract public class BasicLibrary { Story story = save(support.process(pgProcess), pgSave); pg.done(); - return story; + return story.getMeta(); } /** diff --git a/src/be/nikiroo/fanfix/library/CacheLibrary.java b/src/be/nikiroo/fanfix/library/CacheLibrary.java index 019acd2..e8743b6 100644 --- a/src/be/nikiroo/fanfix/library/CacheLibrary.java +++ b/src/be/nikiroo/fanfix/library/CacheLibrary.java @@ -216,11 +216,17 @@ public class CacheLibrary extends BasicLibrary { @Override protected void updateInfo(MetaData meta) throws IOException { if (meta != null && metas != null) { + boolean changed = false; for (int i = 0; i < metas.size(); i++) { if (metas.get(i).getLuid().equals(meta.getLuid())) { metas.set(i, meta); + changed = true; } } + + if (!changed) { + metas.add(meta); + } } cacheLib.updateInfo(meta); @@ -345,7 +351,7 @@ public class CacheLibrary extends BasicLibrary { } @Override - public Story imprt(URL url, Progress pg) throws IOException { + public MetaData imprt(URL url, Progress pg) throws IOException { if (pg == null) { pg = new Progress(); } @@ -356,13 +362,13 @@ public class CacheLibrary extends BasicLibrary { pg.addProgress(pgImprt, 7); pg.addProgress(pgCache, 3); - Story story = lib.imprt(url, pgImprt); - cacheLib.save(story, story.getMeta().getLuid(), pgCache); - - updateInfo(story.getMeta()); - + MetaData meta = lib.imprt(url, pgImprt); + updateInfo(meta); + + clearFromCache(meta.getLuid()); + pg.done(); - return story; + return meta; } // All the following methods are only used by Save and Delete in diff --git a/src/be/nikiroo/fanfix/library/RemoteLibrary.java b/src/be/nikiroo/fanfix/library/RemoteLibrary.java index a6c6854..ce4305a 100644 --- a/src/be/nikiroo/fanfix/library/RemoteLibrary.java +++ b/src/be/nikiroo/fanfix/library/RemoteLibrary.java @@ -78,7 +78,7 @@ public class RemoteLibrary extends BasicLibrary { *
  • wl: flag to allow access to all the stories (bypassing the * whitelist if it exists)
  • * - * + *

    * Some examples: *