TonieToolbox 0.6.0rc3__py3-none-any.whl → 0.6.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
TonieToolbox/__init__.py CHANGED
@@ -3,4 +3,4 @@
3
3
  TonieToolbox - Convert audio files to Tonie box compatible format
4
4
  """
5
5
 
6
- __version__ = '0.6.0rc3'
6
+ __version__ = '0.6.1'
@@ -180,20 +180,23 @@ class ToniesJsonHandlerv1:
180
180
  """
181
181
  logger.trace("Entering add_entry_from_taf() with taf_file=%s, input_files=%s, artwork_url=%s",
182
182
  taf_file, input_files, artwork_url)
183
-
184
183
  if not self.is_loaded:
185
184
  logger.error("Cannot add entry: tonies.custom.json not loaded")
186
185
  return False
187
186
 
188
187
  try:
189
- logger.info("Adding entry for %s to tonies.custom.json", taf_file)
188
+ logger.info("Adding entry for %s to tonies.custom.json", taf_file)
190
189
  logger.debug("Extracting metadata from input files")
191
190
  metadata = self._extract_metadata_from_files(input_files)
192
191
  logger.debug("Extracted metadata: %s", metadata)
192
+ logger.debug("Extracting hash and timestamp from TAF file header")
193
+ from .tonie_analysis import get_header_info
193
194
  with open(taf_file, 'rb') as f:
194
- taf_hash = hashlib.sha1(f.read()).hexdigest().upper()
195
-
196
- timestamp = str(int(time.time()))
195
+ header_size, tonie_header, file_size, audio_size, sha1, opus_head_found, \
196
+ opus_version, channel_count, sample_rate, bitstream_serial_no, opus_comments = get_header_info(f)
197
+ taf_hash = tonie_header.dataHash.hex().upper()
198
+ timestamp = str(bitstream_serial_no)
199
+ logger.debug("Extracted hash: %s, timestamp: %s", taf_hash, timestamp)
197
200
  series = metadata.get('albumartist', metadata.get('artist', 'Unknown Artist'))
198
201
  episodes = metadata.get('album', os.path.splitext(os.path.basename(taf_file))[0])
199
202
  copyright = metadata.get('copyright', '')
@@ -829,15 +832,20 @@ class ToniesJsonHandlerv2:
829
832
 
830
833
  try:
831
834
  logger.info("Adding entry for %s to tonies.custom.json", taf_file)
832
-
833
835
  logger.debug("Extracting metadata from input files")
834
836
  metadata = self._extract_metadata_from_files(input_files)
835
837
  logger.debug("Extracted metadata: %s", metadata)
838
+
839
+ logger.debug("Extracting hash and timestamp from TAF file header")
840
+ from .tonie_analysis import get_header_info
836
841
  with open(taf_file, 'rb') as f:
837
- taf_hash = hashlib.sha1(f.read()).hexdigest()
842
+ header_size, tonie_header, file_size, audio_size, sha1, opus_head_found, \
843
+ opus_version, channel_count, sample_rate, bitstream_serial_no, opus_comments = get_header_info(f)
844
+ taf_hash = tonie_header.dataHash.hex().upper()
845
+ timestamp = bitstream_serial_no
846
+ logger.debug("Extracted hash: %s, timestamp: %s", taf_hash, timestamp)
838
847
 
839
848
  taf_size = os.path.getsize(taf_file)
840
- timestamp = int(time.time())
841
849
  series = metadata.get('albumartist', metadata.get('artist', 'Unknown Artist'))
842
850
  episode = metadata.get('album', os.path.splitext(os.path.basename(taf_file))[0])
843
851
  track_desc = metadata.get('track_descriptions', [])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TonieToolbox
3
- Version: 0.6.0rc3
3
+ Version: 0.6.1
4
4
  Summary: Convert audio files to Toniebox compatible format (.TAF) and interact with TeddyCloud.
5
5
  Home-page: https://github.com/Quentendo64/TonieToolbox
6
6
  Author: Quentendo64
@@ -1,4 +1,4 @@
1
- TonieToolbox/__init__.py,sha256=SnLbjapelQMeop1rcfF4RL0Kmq7TLiIQfGk2MnhySp8,118
1
+ TonieToolbox/__init__.py,sha256=viFuWgxjToGcxMcK5fE58lpecgEZU6BiY5xg2LsoPOw,115
2
2
  TonieToolbox/__main__.py,sha256=KSDasW-QaTzStXSKtemMKxoFV8IWvCmq1Oig5yo8BQs,41573
3
3
  TonieToolbox/artwork.py,sha256=BhAjLWqzui8zUOU9z9P4H3zbCCTOB94aT0MPlqEvZoY,5605
4
4
  TonieToolbox/audio_conversion.py,sha256=xXXsRGPS_yQ_mqtFJiqupLbeXN8__Q2Hg05C94EPC_8,17199
@@ -20,11 +20,11 @@ TonieToolbox/tonie_analysis.py,sha256=KkaZ6vt4sntMTfutyQApI8gvCirMjTW8aeIBSbhtll
20
20
  TonieToolbox/tonie_file.py,sha256=z7yRmK0ujZ6SjF78-xJImGmQ2bS-Q7b-6d2ryYJnmwA,21769
21
21
  TonieToolbox/tonie_header.proto,sha256=WaWfwO4VrwGtscK2ujfDRKtpeBpaVPoZhI8iMmR-C0U,202
22
22
  TonieToolbox/tonie_header_pb2.py,sha256=s5bp4ULTEekgq6T61z9fDkRavyPM-3eREs20f_Pxxe8,3665
23
- TonieToolbox/tonies_json.py,sha256=Icu5ClFbRK0gFuefJkHQNRjeOW79tQV-GZ3hoIATo3M,60768
23
+ TonieToolbox/tonies_json.py,sha256=EULEKA8qYmL5QTLC9jds1o9iiCjJGWZQv4gwrvajkkg,61628
24
24
  TonieToolbox/version_handler.py,sha256=Q-i5_0r5lX3dlwDLI2lMAx4X10UZGN2rvMcntmyuiT4,9862
25
- tonietoolbox-0.6.0rc3.dist-info/licenses/LICENSE.md,sha256=rGoga9ZAgNco9fBapVFpWf6ri7HOBp1KRnt1uIruXMk,35190
26
- tonietoolbox-0.6.0rc3.dist-info/METADATA,sha256=2tycPL42jf92Um34ATsD24dePbCIMH97HsIcV-Sc5Q0,29087
27
- tonietoolbox-0.6.0rc3.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
28
- tonietoolbox-0.6.0rc3.dist-info/entry_points.txt,sha256=oqpeyBxel7aScg35Xr4gZKnf486S5KW9okqeBwyJxxc,60
29
- tonietoolbox-0.6.0rc3.dist-info/top_level.txt,sha256=Wkkm-2p7I3ENfS7ZbYtYUB2g-xwHrXVlERHfonsOPuE,13
30
- tonietoolbox-0.6.0rc3.dist-info/RECORD,,
25
+ tonietoolbox-0.6.1.dist-info/licenses/LICENSE.md,sha256=rGoga9ZAgNco9fBapVFpWf6ri7HOBp1KRnt1uIruXMk,35190
26
+ tonietoolbox-0.6.1.dist-info/METADATA,sha256=-fZc3ny_XZsj5E7zYF7f1xA2cciJqh7HAcmwg004IbI,29084
27
+ tonietoolbox-0.6.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
28
+ tonietoolbox-0.6.1.dist-info/entry_points.txt,sha256=oqpeyBxel7aScg35Xr4gZKnf486S5KW9okqeBwyJxxc,60
29
+ tonietoolbox-0.6.1.dist-info/top_level.txt,sha256=Wkkm-2p7I3ENfS7ZbYtYUB2g-xwHrXVlERHfonsOPuE,13
30
+ tonietoolbox-0.6.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.7.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5