Skip to content

init implementation for browser metadata parsing - #13

Merged
bretth18 merged 2 commits into
mainfrom
b/web-usage-parsing-init
Jul 21, 2026
Merged

init implementation for browser metadata parsing #13
bretth18 merged 2 commits into
mainfrom
b/web-usage-parsing-init

Conversation

@bretth18

@bretth18 bretth18 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Description

This PR introduces a new TrackMetadataCleaner utility to clean up track metadata from web sources, integrates it into the scrobbling flow, and updates the Xcode project configuration to include the new files and tests. It also extends the NowPlayingFetcher to provide the bundle identifier of the current application, enabling smarter metadata handling for tracks coming from browsers and other web sources.

Track metadata cleaning improvements:

  • Added the new TrackMetadataCleaner.swift utility to the project, along with TrackMetadataCleanerTests.swift for unit testing. These files are now included in the project and test targets (scrobble.xcodeproj/project.pbxproj). [1] [2] [3] [4] [5]
  • Integrated TrackMetadataCleaner.cleanIfWebSource into the Scrobbler logic to sanitize track metadata from web sources before further processing, improving the quality of scrobbled data (Scrobbler.swift). [1] [2]

NowPlayingFetcher enhancements:

  • Updated NowPlayingFetcher to track and expose the bundleIdentifier of the current application, and to include it in the fetchCurrentTrackInfo() method. This enables downstream logic to distinguish between native apps and browsers (NowPlayingFetcher.swift). [1] [2] [3] [4]
  • Updated all call sites and signatures in Scrobbler to handle the new bundleIdentifier field when fetching track info (Scrobbler.swift). [1] [2]

Project file and configuration updates:

  • Registered the new source and test files in the Xcode project, ensured correct group placement, and incremented the project version. [1] [2] [3] [4] [5]
  • Fixed an ordering issue with FriendsFilterView.swift in the project file. [1] [2] [3]

These changes improve the accuracy of scrobbled metadata, specifically for tracks played in browsers, and lay the groundwork for more robust handling of various media sources. This unit of work covers the exact case described in #12 , but does not cover cases where a non-DSP channel has uploaded the audio (e.g this track will still return "VNRD - Distant Strangers - Do Anything [DS 001]")

Future work

  • Add optional track metadata resolver to clean metadata pre-scrobble

How to test

  • Ensure all checks pass

Author checklist

This PR:

  • Satisfies a goal that is specific & clearly motivated
  • Adds value in isolation (whether user-facing or sustainability-related)
  • Contains a concise & easy-to-understand title + description
  • Adheres to SRP by default
  • Presents the best possible implementation to meet its goal, given constraints at hand

@bretth18 bretth18 self-assigned this Jul 21, 2026
@bretth18
bretth18 merged commit 399683d into main Jul 21, 2026
2 checks passed
@bretth18
bretth18 deleted the b/web-usage-parsing-init branch July 21, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant