Skip to content

Commit

Permalink
Update pytaglib to v3+
Browse files Browse the repository at this point in the history
  • Loading branch information
titusz committed Jul 1, 2024
1 parent c3c5dde commit ee919f0
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 50 deletions.
79 changes: 41 additions & 38 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ install-jdk = "^0.3"
platformdirs = "*"
jmespath = "^1.0"
Pillow = "*"
pytaglib = "^2.0"
pytaglib = "^3.0"
numpy = "^1.25"
pymupdf = "^1.21"
ebookmeta = "^1.2"
Expand Down
16 changes: 8 additions & 8 deletions tests/test_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def test_audio_meta_extract(mp3_file):
assert idk.audio_meta_extract(mp3_file) == {
"name": "Belly Button",
"duration": 15,
"duration": 15.543,
}


Expand All @@ -26,7 +26,7 @@ def test_audio_meta_extract_concurrent(mp3_file):
data = infile.read(64)
assert idk.audio_meta_extract(mp3_file) == {
"name": "Belly Button",
"duration": 15,
"duration": 15.543,
}


Expand All @@ -42,7 +42,7 @@ def test_audio_meta_embed_mp3(mp3_file):
assert idk.audio_meta_extract(new_file) == {
"acquire": "https://example.com/buy",
"description": "Wörld",
"duration": 15,
"duration": 15.543,
"license": "https://example.com/license",
"meta": "somestring",
"name": "Hello",
Expand All @@ -56,7 +56,7 @@ def test_audio_meta_embed_wav(wav_file):
assert idk.audio_meta_extract(new_file) == {
"acquire": "https://example.com/buy",
"description": "Wörld",
"duration": 15,
"duration": 15.503,
"license": "https://example.com/license",
"meta": "somestring",
"name": "Hello",
Expand Down Expand Up @@ -178,15 +178,15 @@ def test_audio_extract_features(mp3_file):

def test_code_audio_mp3(mp3_file):
assert idk.code_audio(mp3_file).dict() == {
"duration": 15,
"duration": 15.543,
"iscc": "ISCC:EIAWUJFCEZZOJYVD",
"name": "Belly Button",
}


def test_code_audio_wav(wav_file):
assert idk.code_audio(wav_file).dict() == {
"duration": 15,
"duration": 15.503,
"iscc": "ISCC:EIAWUJFCEZZOJYVD",
"name": "Belly Button!",
}
Expand All @@ -206,7 +206,7 @@ def test_audio_thumbnail_via_code_audio(mp3_cover):
meta = idk.code_audio(mp3_cover)
assert meta.dict() == {
"creator": "Test Artist",
"duration": 15,
"duration": 15.543,
"iscc": "ISCC:EIAWUJFCEZZOJYVD",
"name": "Belly Button",
"thumbnail": "data:image/webp;base64,UklGRmYIAABXRUJQVlA4IFoIAADwLACdASqAAIAAPrVIoEunI6MnqxLuEPAWiWUAyYDGziTyWzk95eJOzd1DjXE2+eXupxN0Qz3YOB59cd3kEfdNmJQy1WyKrZL0ieve5u7jDEQZBHP1eRHalEeYsTvyjKctPmH/EhyXGrhKAcpLqqalBQjWH5lJxVE+Vu4/wux1heTE85AttCIUG1W623H62swJ49rDllcaLG5NGuxPu//dN53szy8eT+dnoAnxrDxpOrahi8x4ve/jBsBsRdhU/6A5kknW2+/oBjQxgl4UzIY4cYUKEZ7Ue5VP8xiWOtXn1ng9QEka87N0R2hbazPbbgGJ6mO7OEzn3y5JzaDxmfw8LKY9jTSeiiTsv2KKyKNBxTRY4CVcWogHbHlG/R1k5UKN/qk/arHTdOYl4HZCXyIeXBS1wmiHpC85QAAH5G1kkJVspgUj77iQ50D6loF9YNSmcEMeCl5R6nHVT3DO7H3VBL0wDga827uQlJvyrrtRAAD+3bi9iP3FF4fuz8peSDw/49f47NBrOotDpsPBv+IsGzdbwGVVqMwuLl/PVSKuNhdpy5q6H0oRQfphMC7fR1Rx68cvChSAvmoYSveAeLWTo5L9QQyDkeIf7ovqWc9dwWi74jsFJpJGdCAgTeOixmK2W/B3DrbQsnP37gSRGze/e2P3CvkTpv7t+uJk81T1xcpyLSM5T/wk36nuOUD2wxRNbX9hTaYjk3lSbD/8kaqbx5DrvqKGE2rzvDJFB6Tqu8MPiBqojY1BSqAcIskwbZkq53/wBkcwck5qwWItzj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bHIcCRpvlgEhqLuhZA9KF9d8/7SCnzGMzIZxzVQVwVVmBRvtAnWbLlXuGF9RyoweK48gC/eLC0ZjV7/JHk8vkf+1CABERZ2X+Ji2FjAXSney9g9fPDLxDWt6Vkavb6Fyz2CMlaGiX8maBfgidLZRAu3ClvIRUhOY8CywWKSwI5JFalWh26s0+oWMCoL4lCjZBj14NxmdBQNqflhqkpulNLmq4z+eEWCyG8RMknj3j96ox5WMRMV8K5pKX6U646rqQ+jPr2PRf8ECnf5jbWMFKecXiEhGHxERd6AvqGyHhQTJ9bcN1p4GRoD5kloCcnYPQF2vMea0Nw+QXbr7JKUvtXeJCza6QcKAyxV7tp5NaZ2HVwBNBGJ5DQ7+BaX+o904xxK+yscAvckQQ1/VZwdzr2q1L1Y2paoGKtE3+sb4fzNO7qHPmSfAPj0nM4RH47cnaCwc0n1Yd33bBk3cyCH+UhpNSVTyn6yYWw6sRB3Lb6TkkNM+/886akKMlVaQp8swfsvEB/UbVyHDmMWKfAh7UpcUrcCCupaFYMFnmdcQP4NBFVE++tk7n3J9J86KNYRzAaJ1lkodIgj4ThSUrDebtOAK0NNNJRYEfIx/Pem4wnMQQstrMx+HNk4zDN8LOBLFEVr6K9/ZW9H6YMG3gcfD2rDks7U4wV9tGmp7cGN97q678PfRknYcXK6XY8vItQx2dpHZvjF5L9l4yeL5Xe8EHOUQvFO9H2S2+t17LciKXA+dmJaDzKyGt1AYvKQA/D5xfJZv6/fg2Uh+/dWnmynnAjgBAeATg3knjiaZS+ypN6MVU6tX6/COE009zioMKar7fBbhdhqBYUY9NNGEEvd+biupUMNzXD+aFgG/fAZ09MVmvteK3CLLm7VebWmQzSbUTZl+u8Z8/kXeWhRe/amH3ffz72fV6wzkIbBMUIcxc42bpsrXbVlImaOOnosqZjwFD4WqqNBsagAAA==",
Expand All @@ -216,7 +216,7 @@ def test_audio_thumbnail_via_code_audio(mp3_cover):
def test_audio_embed_title(mp3_cover):
new_file = idk.embed_metadata(mp3_cover, idk.IsccMeta(name="Embedded Title"))
meta = idk.extract_metadata(new_file)
assert meta.dict() == {"creator": "Test Artist", "duration": 15, "name": "Embedded Title"}
assert meta.dict() == {"creator": "Test Artist", "duration": 15.543, "name": "Embedded Title"}


def test_code_audio_metadata_meta_thumb_disabled(mp3_cover):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_cli_create():
"filename": "demo.mp3",
"filesize": 225707,
"mediatype": "audio/mpeg",
"duration": 15,
"duration": 15.543,
"metahash": "1e20c4933dc8c03ea58568159a1cbfb04132c7db93b6b4cd025ffd4db37f52a4756f",
"datahash": "1e20ec93c00fdb76a7cec587e4a2bddfa8d0a0bac8110d0c7130c351ea07c366d626",
}
Expand Down
4 changes: 2 additions & 2 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_code_iscc_audio(mp3_file):
"iscc": "ISCC:KIC2JKSX7OH5PBIENISKEJTS4TRKHYJBCZDNLQXYILWJHQAP3N3KPTQ",
"name": "Belly Button",
"datahash": "1e20ec93c00fdb76a7cec587e4a2bddfa8d0a0bac8110d0c7130c351ea07c366d626",
"duration": 15,
"duration": 15.543,
"filesize": 225707,
"filename": "audio.mp3",
"mediatype": "audio/mpeg",
Expand Down Expand Up @@ -83,7 +83,7 @@ def test_code_meta_image(jpg_file):

def test_code_meta_audio(mp3_file):
assert idk.code_meta(mp3_file).dict() == {
"duration": 15,
"duration": 15.543,
"iscc": "ISCC:AAA2JKSX7OH5PBIE",
"metahash": "1e20c4933dc8c03ea58568159a1cbfb04132c7db93b6b4cd025ffd4db37f52a4756f",
"name": "Belly Button",
Expand Down

0 comments on commit ee919f0

Please sign in to comment.