Commit Graph

91 Commits

Author SHA1 Message Date
Timmy Welch
9137cee3cd Fix edgecases with filerenaming
Add warnings in gui for sub-optimal rename templates
Fix using lists when renaming
Explicitly disallow fields starting with `_`
Mark credit roles with prefix `credit_` so that values will properly
  return None for unkown roles
Add `credit_item_` prefix to allow direct usage of the credit class

Make filename tests more readable
2025-08-10 19:42:40 -07:00
Timmy Welch
98c3ea23ff Parse a new weird filename
Lexer now matches month/day names ran together (eg Aug23)
Parser:
  Now strips off an apostrophe ' in front of a 4 digit number
  Now automatically activates skip if it's found c2c
    or there are >= 3 bracket groups
  Skips a < 3 digit number after a month/day name assuming it is the
    day of the month
2025-08-10 15:47:52 -07:00
Timmy Welch
e816232e59 Filerenamer enhancements
Allow None replacements to reference other fields
Only do standard replacements and duplicate space removal on field values
Remove filename sanitation of field values
    Filename sanitation is performed when doing the actual move
2025-07-01 19:21:19 -07:00
Timmy Welch
af693f4f25 Improve smart text cleanup 2025-07-01 18:16:50 -07:00
Kijaru
38e7789c7b Add support for GTIN identifier 2025-05-17 11:54:59 +02:00
Timmy Welch
12f1d11ee8 Merge branch 'mizaki/issue_hash_cover' into develop 2025-05-05 00:20:57 -07:00
Mizaki
3c062a1cd3 Alter invalid hash test from hash value to kind value 2025-05-04 22:32:09 +01:00
Mizaki
506fac03c7 Use ImageHash solely 2025-04-17 23:48:53 +01:00
Timmy Welch
575d36b67f Update typing 2025-03-18 19:55:28 -07:00
Mizaki
a0be90bbf5 Add URL to ImageHash and use in issue window 2025-02-28 16:55:56 +00:00
Mizaki
085b599bc4 Parametrise cover match test and add ImageHash data 2025-02-23 18:11:40 -08:00
Timmy Welch
bf0a46055a Fix parsing ' in filenames
Fixes #672
2024-12-06 23:18:45 -08:00
Timmy Welch
39a4a37d7c Add tests 2024-09-19 19:03:30 -07:00
Timmy Welch
1803a37591 Handle None values when doing conversions and catch indexing errors 2024-09-17 09:20:11 -07:00
Timmy Welch
d62dff49b4 Fix overlay tests 2024-07-27 19:39:15 -07:00
Timmy Welch
c28dc19df6 Improve filename parsing 2024-06-29 18:43:40 -07:00
Timmy Welch
3389c72a63 Merge branch 'help-messages' into develop 2024-06-21 19:53:30 -07:00
Timmy Welch
69a9566f42 Update all references of saved 'matadata' to 'tags' 2024-06-20 16:47:10 -07:00
Timmy Welch
979a54e2b8 Fix lexing a dot '.' as a symbol
Fixes #652
2024-06-03 13:06:49 -07:00
Mizaki
a40438d38c Separate list merge into a separate option (lordwelch) 2024-05-11 16:42:24 +01:00
Mizaki
3d443e0908 lordwelch rewrite 2024-05-11 02:04:43 +01:00
Mizaki
71b79bdc91 Move some overlay test data to testing/comicdata.py 2024-05-11 02:02:01 +01:00
Mizaki
93be16f7eb Remove data to test empty string->None for series and issue as an empty string will never make it to genericmetadata now 2024-05-11 01:56:10 +01:00
Timmy Welch
887c383229 Fix an infinite loop issue parsing numbers outside of 0-9 fixes #639 2024-04-29 10:20:25 -07:00
Timmy Welch
d63123b77b Add tests for prepare_metadata 2024-04-28 13:53:41 -07:00
Timmy Welch
8b4bf8d51f Allow preserving the original filename when moving 2024-04-27 19:25:33 -07:00
Timmy Welch
3df263858d Merge branch 'web-links' into develop 2024-03-09 13:42:29 -08:00
Timmy Welch
bad8b85874 Fix tests 2024-02-24 18:30:41 -08:00
Timmy Welch
2eca743f20 Fix #602
Tests were not made correctly to catch the change in 2c3a2566cc
This has now been corrected
2024-02-18 17:31:00 -08:00
Timmy Welch
b2d3869488 Update filerenaming for web_links
Ensure the j specifier in MetadataFormatter converts to str before joining
Add a web_link variable to the filerenamer
2024-02-17 17:42:07 -08:00
Timmy Welch
44e9a47a8b Support multiple web_links 2024-02-17 17:42:07 -08:00
pre-commit-ci[bot]
df762746ec [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-01-29 17:14:26 +00:00
Timmy Welch
bb67ab009e Ensure that all output goes through a logger before output to the user
Adds an option to output json for CLI options
2023-12-17 15:51:43 -08:00
Timmy Welch
1ff6f1768b Use importlib.resources instead of __file__ 2023-11-25 12:32:50 -08:00
Timmy Welch
305eb1dec5 Enable stricter mypy configuration 2023-11-23 16:05:16 -08:00
Timmy Welch
bd9b3522d8 Improve edge cases
Lex `'` as a symbol
Lex multiple symbols as a single item
Prefer `$` at the start of a number
Simplify issue number parsing
2023-10-27 23:26:40 -07:00
Timmy Welch
29ddc3779a Ensure FilenameInfo is always filled out fixes #556 2023-10-23 21:08:55 -07:00
Timmy Welch
114a0bb615 Fix parsing '&' with the "complicated" filename parser 2023-10-12 01:26:31 -07:00
Timmy Welch
abfd97d915 Merge branch 'protofolius_issue_scheme' into develop 2023-10-11 17:05:27 -07:00
Timmy Welch
582b8cc57b Add more parseable filenames 2023-10-11 17:03:07 -07:00
Timmy Welch
78a890f900 Fix parsing a month name in the series fixes #542 2023-10-06 20:06:39 -07:00
Timmy Welch
f250d2c5c3 Merge branch 'mizaki-gmd_list_set' into develop 2023-10-04 20:16:33 -07:00
Mizaki
058651cc29 Change metadata lists to sets. Changed CV talker to reflect and tidied 2023-09-24 14:33:57 +01:00
Mizaki
5874f3bcaf Remove genres from ComicSeries as it is no longer required with the new cache system 2023-09-22 23:15:04 +01:00
Timmy Welch
f6be7919d7 Implement support for protofolius's permission scheme 2023-09-06 04:50:05 -04:00
Timmy Welch
f72ebdb149 Simplify ComicCacher to store a single binary data field and ID(s)
If the ComicCacher is to be a generic cache for talkers it must assume
 very little. Current assumptions:
 - There are issues that can be queried individually by an "Issue ID" and they have a relation to a single series
 - There are series that can be queried individually by an "Series ID" and they have a relation to zero or more issues
 - There are Searches that can be queried by the search term and they have a relation to zero or more series

Each series and issue have a boolean `complete` attribute which is up to the talker to decide what it means.
Data is returned as a tuple ([series, complete] or [issue, complete]) or a list of tuples
An issue consists of an ID, an series ID and a binary data attribute which is up to the talker to determine what it means.
An series consists of in ID and a binary data attribute which is up to the talker to determine what it means.

The data attribute is binary to allow for compression and efficient storage of binary data (e.g. pickle) it is suggested to store it as json or similar text format encoded with utf-8. If the talker is using a website API it is suggested to store the raw response from the server.

All caches automatically expire 7 days after insertion.
2023-08-05 03:02:12 -07:00
Timmy Welch
ea84031b87 Add more 4-digit issue number tests 2023-08-04 21:04:21 -07:00
Timmy Welch
2c3a2566cc Convert ComicIssue into GenericMetadata
I could not find a good reason for ComicIssue to exist other than that
 it had more attributes than GenericMetadata, so it has been replaced.
New attributes for GenericMetadata:
  series_id:        a string uniquely identifying the series to tag_origin
  series_aliases:   alternate series names that are not the canonical name
  title_aliases:    alternate issue titles that are not the canonical name
  alternate_images: a list of urls to alternate cover images

Updated attributes for GenericMetadata:
  genre        -> genres:        str -> list[str]
  comments     -> description:   str -> str
  story_arc    -> story_arcs:    str -> list[str]
  series_group -> series_groups: str -> list[str]
  character    -> characters:    str -> list[str]
  team         -> teams:         str -> list[str]
  location     -> locations:     str -> list[str]
  tag_origin   -> tag_origin:    str -> TagOrigin (tuple[str, str])

ComicSeries has been relocated to the ComicAPI package, currently has no
 usage within ComicAPI.
CreditMetadata has been renamed to Credit and has replaced Credit from
 ComicTalker.
fetch_series has been added to ComicTalker, this is currently only used
 in the GUI when a series is selected and does not already contain the
 needed fields, this function should always be cached.

A new split function has been added to ComicAPI, all uses of split on
 single characters have been updated to use this

cleanup_html and the corresponding setting are now only used in
 ComicTagger proper, for display we want any html directly from the
 upstream. When applying the metadata we then strip the description of
 any html.

A new conversion has been added to the MetadataFormatter:
  j: joins any lists into a string with ', '. Note this is a valid
     operation on strings as well, it will add ', ' in between every
     character.

parse_settings now assigns the given ComicTaggerPaths object to the
 result ensuring that the correct path is always used.
2023-08-02 09:00:04 -07:00
Mizaki
2187ddece8 Move volume from ComicSeries to ComicIssue 2023-06-23 22:38:15 +01:00
Timmy Welch
635cb037f1 Merge branch 'mizaki-fix_add_fields' into develop 2023-06-22 17:51:26 -07:00