Commit Graph

83 Commits

Author SHA1 Message Date
Timmy Welch
95643fdace Fix community rating
The user rating control is replaced with critical rating which is now
represented as a float.
utils.xlate has been updated to have an is_float parameter
Metadata is reloaded on save so that changes can be seen
e.g. for CBL tags the critical rating field only stores integers
2022-06-23 13:18:42 -07:00
Timmy Welch
b9af606f87 Improve filename parsing and cover image scaling
Cover image scaling now uses the smooth transformation option in Qt
Filename parsing now identifies a single number as a filename
e.g. '52.cbz' gets parsed as issue: 52 and series: 52
2022-06-09 12:31:57 -07:00
Timmy Welch
ff73cbf2f9 Fix small issues
Fix spelling errors
Remove Redundant exception types
Remove dead code
Change the forum link to point to GitHub discussions
2022-06-07 20:22:33 -07:00
Timmy Welch
ce693b55f1 Fix file write semantics for Windows 2022-06-07 12:53:27 -07:00
Timmy Welch
db37ec7204 Add a literal search option 2022-06-07 12:16:23 -07:00
Timmy Welch
04409a55c7 Handle more exceptions
Handle exceptions during metadata save fixes #309
Handle exceptions during metadata read fixes #126 and #309
2022-06-06 20:04:51 -07:00
Timmy Welch
5bb48cf816 fix rar test 2022-06-06 20:04:34 -07:00
Timmy Welch
e8fa51ad45 Ensure comicapi is as consistent as possible 2022-06-02 18:32:33 -07:00
Timmy Welch
fd4c453854 Apply pre-commit configuration 2022-06-02 18:32:16 -07:00
Timmy Welch
c19ed49e05 Move to argparse for argument parsing 2022-06-02 18:28:54 -07:00
lordwelch
8b73a87360 Merge branch 'cleanup' into develop 2022-05-24 11:44:54 -07:00
lordwelch
8c591a8a3b Remove unused imports 2022-05-24 11:44:26 -07:00
lordwelch
c5772c75e5 Cleanup setCheckState
Fix word splitting when auto-tagging
Remove commented code
2022-05-24 11:38:10 -07:00
lordwelch
98a7ee35ee Add tests 2022-05-24 11:30:25 -07:00
lordwelch
10056c4229 Improve volume handling
Include changes by @gramster from #120
During filename parsing set the issue to the volume if there is no issue
2022-05-24 11:27:24 -07:00
lordwelch
1468b1932f Fix crash on startup
Add publishers.json to pip package
Add exception handling to prevent crash
2022-05-19 20:13:59 -07:00
lordwelch
d33fb6ef31 Fix build errors
Add wordninja to requirements.txt
Fix typing to allow unrar-cffi to be optional
2022-05-19 18:08:05 -07:00
lordwelch
4201558483 Merge branch 'wordSplit' into develop 2022-05-19 17:58:45 -07:00
lordwelch
d3f552173e Merge branch 'AutoImprint' into develop 2022-05-19 13:28:18 -07:00
lordwelch
3e3dcb03f9 Typed 2022-05-19 13:19:19 -07:00
lordwelch
9a9d97f3bb Fix #291
ComicTagger now accounts for any single unicode numeric value
2022-05-14 01:59:44 -07:00
lordwelch
a4cb8b51a6 Restore test cbz
Add test to ensure that metadata is read correctly
Add tests for IssueString
2022-05-14 01:59:39 -07:00
Timmy Welch
1bbdebff42 Merge branch 'filenameParser' into develop 2022-05-06 00:33:36 -07:00
Timmy Welch
205d337751 Add new filename parser
I created a new, mostly over complicated, filename parser
The new parser works well in many cases and will collect more data than
the original parser but will sometimes give odd results because of how
complicated it has been made e.g.
'100 page giant' will cause issues however '100-page giant' will not

Remove the parse scan info setting as it was not respected in many cases
2022-05-06 00:30:33 -07:00
Timmy Welch
48467b14b5 Remove utils.indent, python 3.9 provides a similar function 2022-04-30 00:01:00 -07:00
Timmy Welch
fa0c193730 Merge branch 'MichaelFitzurka-feature-258/community-rating' into develop 2022-04-29 23:22:58 -07:00
MichaelFitzurka
08434a703e Remove empty versus clearing. 2022-04-22 09:48:47 -04:00
MichaelFitzurka
552a319298 Adding CommunityRating. fitxes #258 2022-04-22 09:39:32 -04:00
Timmy Welch
135544c0db Code cleanup 2022-04-20 13:13:03 -07:00
Timmy Welch
168f24b139 Partial revert of 'e616aa8373688fe0ee7394ddad5b409653354271'
Changing PageType to an Enum creates too many issues
2022-04-20 11:41:42 -07:00
Timmy Welch
d78c3e3039 Fix serialization errors
Add tests to ensure issue is fixed
Add make check
Add pytest to make CI
2022-04-19 13:16:33 -07:00
Timmy Welch
caa94c4e28 Merge branch 'Renaming' into develop 2022-04-18 22:56:49 -07:00
Timmy Welch
7037877a77 Add a strict mode to file renaming
Strict renaming removes all reserved names and characters regardless
 of operating system, with out strict mode only for the current
 Operating System
Add more edge cases to smart cleanup
Add more tests for file renaming
2022-04-18 22:55:13 -07:00
Timmy Welch
6cccf22d54 Allow switching between old and new rename templates
Show a message dialog explaining that there is a new template format
Add a dynamic label to show the effect of a rename
Add tests for FileRenamer
Remove the filename parameter from the determine_name function
2022-04-18 20:12:20 -07:00
Timmy Welch
0fe881df59 Code cleanup 2022-04-18 19:40:04 -07:00
Timmy Welch
028b728d82 Improve file renaming
Moves to Python format strings for renaming, handles directory
structures, moving of files to a destination directory, sanitizes
file paths with pathvalidate and takes a different approach to
smart filename cleanup using the Python string.Formatter class

Moving to Python format strings means we can point to python
documentation for syntax and all we have to do is document the
properties and types that are attached to the GenericMetadata class.

Switching to pathvalidate allows comictagger to more simply handle both
directories and symbols in filenames.

The only changes to the string.Formatter class is:
1. format_field returns
an empty string if the value is none or an empty string regardless of
the format specifier.
2. _vformat drops the previous literal text if the field value
is an empty string and lstrips the following literal text of closing
special characters.
2022-04-18 18:52:53 -07:00
Timmy Welch
49210e67c5 Fix rar_support variable 2022-04-14 16:25:25 -07:00
Timmy Welch
4f08610a28 Fix CI 2022-04-14 13:16:51 -07:00
lordwelch
f3095144f5 Merge branch 'feature/149-add-tests' into develop 2022-04-12 15:20:58 -07:00
Timmy Welch
6da177471b Fix #242
Fix file encoding inconsistencies, windows defaults to cp1252, which is
not Unicode compatible.
Add logging for all exceptions in the comicapi package
Ensure that all exceptions are logged and shown to the user
2022-04-11 14:52:41 -07:00
Timmy Welch
cd9a02c255 Merge branch 'feature/246-dbl-page' of https://github.com/MichaelFitzurka/comictagger into MichaelFitzurka-feature/246-dbl-page 2022-04-10 10:54:49 -07:00
MichaelFitzurka
e622b56dae Adding attribs to ImageMetadata class. 2022-04-05 11:23:18 -04:00
abuchanan920
d4470a2015
Use more idiomatic regular expression string
Co-authored-by: Timmy Welch <timmy@narnian.us>
2022-04-05 10:37:33 -04:00
Andrew W. Buchanan
c9b5bd625f Fix parsing of filenames that end with an ID such as [__######__] 2022-04-04 22:34:31 -04:00
Timmy Welch
c50cef568e Add basic logging 2022-04-04 19:10:22 -07:00
MichaelFitzurka
ada88d719f Empty metadata should not assign an empty tag. 2022-04-03 16:50:27 -04:00
MichaelFitzurka
1b28623fe3 Bookmark functionality. Fixes #212. 2022-04-03 15:44:20 -04:00
MichaelFitzurka
593f568ea7 method renamed to match new changes. 2022-04-03 15:39:03 -04:00
Timmy Welch
7b4dba35b5 Ensure that tags are overwritten when saving metadata 2022-04-02 15:41:50 -07:00
Timmy Welch
e10f7dd7a7 Code cleanup
Remove no longer used google scripts
Remove convenience files from comicataggerlib and import comicapi directly
Add type-hints to facilitate auto-complete tools
Make PyQt5 code more compatible with PyQt6

Implement automatic tooling
isort and black for code formatting
Line length has been set to 120
flake8 for code standards with exceptions:
E203 - Whitespace before ':'  - format compatiblity with black
E501 - Line too long          - flake8 line limit cannot be set
E722 - Do not use bare except - fixing bare except statements is a
                                lot of overhead and there are already
                                many in the codebase

These changes, along with some manual fixes creates much more readable code.
See examples below:

diff --git a/comicapi/comet.py b/comicapi/comet.py
index d1741c5..52dc195 100644
--- a/comicapi/comet.py
+++ b/comicapi/comet.py
@@ -166,7 +166,2 @@ class CoMet:

-            if credit['role'].lower() in set(self.editor_synonyms):
-                ET.SubElement(
-                    root,
-                    'editor').text = "{0}".format(
-                    credit['person'])

@@ -174,2 +169,4 @@ class CoMet:
         self.indent(root)
+            if credit["role"].lower() in set(self.editor_synonyms):
+                ET.SubElement(root, "editor").text = str(credit["person"])

diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py
index 4338176..9219f01 100644
--- a/comictaggerlib/autotagmatchwindow.py
+++ b/comictaggerlib/autotagmatchwindow.py
@@ -63,4 +63,3 @@ class AutoTagMatchWindow(QtWidgets.QDialog):
             self.skipButton, QtWidgets.QDialogButtonBox.ActionRole)
-        self.buttonBox.button(QtWidgets.QDialogButtonBox.Ok).setText(
-            "Accept and Write Tags")
+        self.buttonBox.button(QtWidgets.QDialogButtonBox.StandardButton.Ok).setText("Accept and Write Tags")

diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py
index 688907d..dbd0c2e 100644
--- a/comictaggerlib/cli.py
+++ b/comictaggerlib/cli.py
@@ -293,7 +293,3 @@ def process_file_cli(filename, opts, settings, match_results):
                 if opts.raw:
-                    print((
-                        "{0}".format(
-                            str(
-                                ca.readRawCIX(),
-                                errors='ignore'))))
+                    print(ca.read_raw_cix())
                 else:
2022-04-02 14:21:37 -07:00