Skip to content

Commit

Permalink
Merge pull request #298 from bohning/make_some_fixes_optional
Browse files Browse the repository at this point in the history
Make fixing linebreaks, first words capitalization and spaces optional.
  • Loading branch information
RumovZ authored Oct 19, 2024
2 parents aa43691 + 480974c commit a160e87
Show file tree
Hide file tree
Showing 11 changed files with 436 additions and 197 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
- Comments can now be posted on songs. Each comment includes a message and a rating.
Ratings can be negative, neutral, or positive, with neutral being the default.
- The VP9 codec can be excluded for mp4 video containers (see _Settings_).
- Tags (and artwork, if selected) are now also written to the video file (mp4 only).
- Tags such as artist, title and year are now also written to the video file (mp4 only).
- Some text file fixes are now optional and can be configured in the settings:
- fix linebreaks (disabled | USDX style | YASS style)
- fix first words capitalization (disabled | enabled)
- fix spaces (after words | before words)

## Developer notes

Expand Down
11 changes: 10 additions & 1 deletion src/usdb_syncer/download_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class TxtOptions:

encoding: settings.Encoding
newline: settings.Newline
fix_linebreaks: settings.FixLinebreaks
fix_first_words_capitalization: bool
fix_spaces: settings.FixSpaces


@dataclass(frozen=True)
Expand Down Expand Up @@ -93,7 +96,13 @@ def download_options() -> Options:
def _txt_options() -> TxtOptions | None:
if not settings.get_txt():
return None
return TxtOptions(encoding=settings.get_encoding(), newline=settings.get_newline())
return TxtOptions(
encoding=settings.get_encoding(),
newline=settings.get_newline(),
fix_linebreaks=settings.get_fix_linebreaks(),
fix_first_words_capitalization=settings.get_fix_first_words_capitalization(),
fix_spaces=settings.get_fix_spaces(),
)


def _audio_options() -> AudioOptions | None:
Expand Down
Loading

0 comments on commit a160e87

Please sign in to comment.