lyrics-transcriber 0.35.0__py3-none-any.whl → 0.36.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.
Files changed (25) hide show
  1. lyrics_transcriber/cli/cli_main.py +2 -0
  2. lyrics_transcriber/core/config.py +1 -1
  3. lyrics_transcriber/core/controller.py +13 -0
  4. lyrics_transcriber/frontend/dist/assets/{index-CQCER5Fo.js → index-ztlAYPYT.js} +23 -23
  5. lyrics_transcriber/frontend/dist/index.html +1 -1
  6. lyrics_transcriber/frontend/src/components/AudioPlayer.tsx +18 -7
  7. lyrics_transcriber/frontend/src/components/CorrectionMetrics.tsx +28 -26
  8. lyrics_transcriber/frontend/src/components/DetailsModal.tsx +94 -4
  9. lyrics_transcriber/frontend/src/components/EditModal.tsx +1 -1
  10. lyrics_transcriber/frontend/src/components/LyricsAnalyzer.tsx +18 -17
  11. lyrics_transcriber/frontend/src/components/ReferenceView.tsx +7 -0
  12. lyrics_transcriber/frontend/src/components/shared/components/HighlightedText.tsx +7 -4
  13. lyrics_transcriber/frontend/src/components/shared/components/SourceSelector.tsx +17 -19
  14. lyrics_transcriber/frontend/src/components/shared/hooks/useWordClick.ts +2 -2
  15. lyrics_transcriber/frontend/src/components/shared/types.ts +3 -3
  16. lyrics_transcriber/frontend/src/components/shared/utils/newlineCalculator.ts +1 -1
  17. lyrics_transcriber/frontend/src/components/shared/utils/referenceLineCalculator.ts +1 -1
  18. lyrics_transcriber/frontend/src/types.ts +3 -12
  19. lyrics_transcriber/lyrics/base_lyrics_provider.py +1 -0
  20. lyrics_transcriber/lyrics/file_provider.py +89 -0
  21. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/METADATA +1 -1
  22. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/RECORD +25 -24
  23. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/LICENSE +0 -0
  24. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/WHEEL +0 -0
  25. {lyrics_transcriber-0.35.0.dist-info → lyrics_transcriber-0.36.1.dist-info}/entry_points.txt +0 -0
@@ -39,6 +39,7 @@ def create_arg_parser() -> argparse.ArgumentParser:
39
39
  song_group = parser.add_argument_group("Song Identification")
40
40
  song_group.add_argument("--artist", help="Song artist for lyrics lookup and auto-correction")
41
41
  song_group.add_argument("--title", help="Song title for lyrics lookup and auto-correction")
42
+ song_group.add_argument("--lyrics_file", help="Path to file containing lyrics (txt, docx, or rtf format)")
42
43
 
43
44
  # API Credentials
44
45
  api_group = parser.add_argument_group("API Credentials")
@@ -134,6 +135,7 @@ def create_configs(args: argparse.Namespace, env_config: Dict[str, str]) -> tupl
134
135
  lyrics_config = LyricsConfig(
135
136
  genius_api_token=args.genius_api_token or env_config.get("genius_api_token"),
136
137
  spotify_cookie=args.spotify_cookie or env_config.get("spotify_cookie"),
138
+ lyrics_file=args.lyrics_file,
137
139
  )
138
140
 
139
141
  output_config = OutputConfig(
@@ -18,7 +18,7 @@ class LyricsConfig:
18
18
 
19
19
  genius_api_token: Optional[str] = None
20
20
  spotify_cookie: Optional[str] = None
21
-
21
+ lyrics_file: Optional[str] = None
22
22
 
23
23
  @dataclass
24
24
  class OutputConfig:
@@ -13,6 +13,7 @@ from lyrics_transcriber.lyrics.spotify import SpotifyProvider
13
13
  from lyrics_transcriber.output.generator import OutputGenerator
14
14
  from lyrics_transcriber.correction.corrector import LyricsCorrector
15
15
  from lyrics_transcriber.core.config import TranscriberConfig, LyricsConfig, OutputConfig
16
+ from lyrics_transcriber.lyrics.file_provider import FileProvider
16
17
 
17
18
 
18
19
  @dataclass
@@ -171,10 +172,16 @@ class LyricsTranscriber:
171
172
  provider_config = LyricsProviderConfig(
172
173
  genius_api_token=self.lyrics_config.genius_api_token,
173
174
  spotify_cookie=self.lyrics_config.spotify_cookie,
175
+ lyrics_file=self.lyrics_config.lyrics_file,
174
176
  cache_dir=self.output_config.cache_dir,
175
177
  audio_filepath=self.audio_filepath,
176
178
  )
177
179
 
180
+ if provider_config.lyrics_file and os.path.exists(provider_config.lyrics_file):
181
+ self.logger.debug(f"Initializing File lyrics provider with file: {provider_config.lyrics_file}")
182
+ providers["file"] = FileProvider(config=provider_config, logger=self.logger)
183
+ return providers
184
+
178
185
  if provider_config.genius_api_token:
179
186
  self.logger.debug("Initializing Genius lyrics provider")
180
187
  providers["genius"] = GeniusProvider(config=provider_config, logger=self.logger)
@@ -196,13 +203,19 @@ class LyricsTranscriber:
196
203
  def process(self) -> LyricsControllerResult:
197
204
  """Main processing method that orchestrates the entire workflow."""
198
205
 
206
+ self.logger.info(f"LyricsTranscriber controller beginning processing for {self.artist} - {self.title}")
207
+
199
208
  # Step 1: Fetch lyrics if enabled and artist/title are provided
200
209
  if self.output_config.fetch_lyrics and self.artist and self.title:
201
210
  self.fetch_lyrics()
211
+ else:
212
+ self.logger.info("Skipping lyrics fetching - no artist/title provided or fetching disabled")
202
213
 
203
214
  # Step 2: Run transcription if enabled
204
215
  if self.output_config.run_transcription:
205
216
  self.transcribe()
217
+ else:
218
+ self.logger.info("Skipping transcription - transcription disabled")
206
219
 
207
220
  # Step 3: Process and correct lyrics if enabled AND we have transcription results
208
221
  if self.output_config.run_correction and self.results.transcription_results: