Skip to content
Merged

Dev #35

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,5 @@ cython_debug/

.vscode/
Makefile

project_dump.txt
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [1.0.3] - 2025-12-26

### Removed
- Index parsing stdout warning.

### Changed
- The track field type of TrackData from *int|None* to *int*, and now it is mandatory in the model.

## [1.0.2] - 2025-12-18

### Added
- py.typed that should allow MyPy to correctly analyse custom types.
- seconds property in the FrameTime.
- py.typed file that should allow MyPy to correctly analyse custom types.
- Seconds property in the FrameTime.

### Fixed
- CHANGELOG versions diff link.
Expand Down Expand Up @@ -96,7 +104,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Dataclasses for data models.


[Unreleased]: https://github.com/Olezhich/CueTools/compare/v1.0.2...main
[Unreleased]: https://github.com/Olezhich/CueTools/compare/v1.0.3...main
[1.0.3]: https://github.com/Olezhich/CueTools/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/Olezhich/CueTools/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/Olezhich/CueTools/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/Olezhich/CueTools/compare/v0.1.5...v1.0.0
Expand Down
3 changes: 1 addition & 2 deletions cuetools/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class TrackData(BaseModel):
file: Path = Field(
description='Path to the audio file with this track (to flac, ape or etc.) relative to the cue sheet file',
)
track: int | None = Field(
default=None,
track: int = Field(
description="Track number, corresponds to the line like *'TRACK 01 AUDIO'*",
)
title: str | None = Field(default=None, description='Track title')
Expand Down
1 change: 0 additions & 1 deletion cuetools/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def load_f_iter(cue: Iterator[str], strict_title_case: bool = False) -> AlbumDat
current_track.index00 = tokens[1].lexeme # type: ignore[assignment]
elif index_type == 1:
current_track.index01 = tokens[1].lexeme # type: ignore[assignment]
print('INDEX WARN:: ', tokens[1].lexeme, current_track.index01)
case _:
raise CueParseError(
current_line,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cuetools"
version = "1.0.2"
version = "1.0.3"
description = "Lightweight CUE sheet toolkit for Python"
authors = [
{name = "Olezhich"}
Expand Down
7 changes: 7 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,10 @@ def test_line_parsing():
INDEX 01 00:00:65"""
cue = cuetools.loads(cue_sheet)
logger.debug(cue)

cue_sheet = """FILE "track.flac" WAVE
INDEX 00 00:00:50
INDEX 01 00:00:65"""
with pytest.raises(cuetools.CueParseError) as e:
cuetools.loads(cue_sheet)
logger.debug(str(e.value))
2 changes: 1 addition & 1 deletion tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def test_FrameTime():
track = TrackData(index00='01:50:05', index01=9000, file=Path('/')) # type: ignore
track = TrackData(index00='01:50:05', index01=9000, file=Path('/'), track=1) # type: ignore
assert track.index00.frames == 8255, 'using string to FrameTime cast' # type: ignore
assert track.index01.string == '02:00:00', 'using int to FrameTime cast'

Expand Down