Skip to content

v0.21.3

Latest

Choose a tag to compare

@FoxxMD FoxxMD released this 25 Nov 17:52
· 1 commit to master since this release

What's New?

New Transform Features

Play Transforms includes two new features that enable you to filter out, or flag, Plays that should not be automatically scrobbled.

Set Play State Based on Stage Outcome

Play State Control adds additional configuration next to Stage Flow Control on your stages. It allows you to set the state of a Play based on the outcome of the Stage.

In plain terms, you can now do this:

  • if the Musicbrainz Stage matches your Play data, use its corrected data (and continue as normal)
  • If the Musicbrainz Stage fails to match your Play data, set the Play state as Needs Review and do not forward it to a Client (or scrobble it)

with this configuration:

{
  "playTransform": {
    "preCompare": [
      {
        "type": "musicbrainz",
        "onFailureAction": "review"
      }
    ]
  }
}

Possible actions are:

  • approve - operate as normal or negate one of the below actions
  • discard - drop this Play, set state as Discarded and do not forward it
  • review - flag for review, set state as Needs Review and do not forward it

These can be set for the same types as Stage Control: onSuccessAction, onFailureAction, and onSkipAction

These actions also persist through all Stages so you can, for example, "mark" a Play as review in an earlier Stage then clear it in a later Stage with approve.

This gives you granular control over what type of Plays end up being processed. Plays set to Discarded and Needs Reviews can be filtered/searched for in the dashboard.

These actions also apply to Export Jobs:

  • A Play that gets discard can be dropped before exporting, or exported directly as Discarded to the Client
  • A Play that gets review is exported directly as In Review to the Client

Match Stage

The Match Stage is a pure comparison stage that does not make any modifications to your Play data. Use it to match, or compare, different properties of the Play being processed. If your rules match, the Stage succeeds, if it does not match then Stage fails.

This Stage is particularly useful with the above Play State Controls, use it to match on patterns in your Play data and set an action without needing to modify the Play.

Lastly, You can now match on additional properties in when conditions as well as with Match:

  • user deviceId library playlist and musicService - if the Play includes these, matched with string/regex
  • duration (length of a track) and listenedFor (how long you listened to it) - matched with a comparison and time unit IE "duration": "< 45 s" => match when play length is less than 45 seconds

ATProto and Mirrors

ATProto Source/Client (Teal.fm and Rocksky) share code with the new Mirrors concept from Import/Export Jobs but did not actually leverage them in the last release.

This release converts the historical plays and Sync operations for these Sources/Clients into locked Mirrors that are now visible from the Mirrors page.

Additionally, their usage of repo exports (CAR files) has been improved to reduce the amount of space each Play takes up and, when used for checking for duplicates, now dynamically imports historical Play ranges as needed rather than requiring the entire repository be parsed into the database.

This requires an automatic migration that will occur after upgrading. If you have a large (10k+ scrobbles) history in teal.fm/rocksky and are using either of these source/clients today you may want to reclaim disk space after upgrading.

Listenbrainz and Native Transform Improvements

Listenbrainz Source/Endpoint, and the Native Transform Stage, share some code that tries to extract artists out of artist/title strings (like Foo feat. Cool Guy).

That code has now been consolidated and improved so testing is easier, the functionality is more flexible, and extraction decisions are auditable.

After upgrading, Plays parsed from LZ sources and in Native Transform will surface a new timeline parse event that details how extraction decisions were made with a diff of the exact changes made to artists/title.

image image image

Hardening Ingress Routes and Sources

Ingress Source routes, like Listenbrainz and Webscrobbler, are not gated by Authentication because they need to stay compatible with third party clients that use them.

More improvements have now been made to these routes to harden them for public exposure:

  • If you do not have any Sources using these routes then requests to them are always dropped without reading/parsing any part of the request
  • When Sources using them are present, auth/identification (matching on token or slug) is now done before the body is of the request is parsed
  • Tracking ingress through logging (showing first request from IP/user agent) has been hardened to keep in-memory usage minimal

Important

In addition to the above, using these Sources without some kind of auth/identification is now deprecated and will result in invalid config in a future release.

Previously, not configuring a token/slug (LZ), an apiKey/slug (LFM), or slug (web scrobbler) resulted in requests that did not match anything falling back to using this "open" configuration. In a future release this will not be allowed.

If you are using this kind of configuration you should update your configurations and third party clients as soon as possible.

Import/Export Job Data Issues Insight

Import Jobs now surface more info about skipped data

image

MS now looks for common data issues in a Mirror's imported data:

  • invalid timestamps (before jan 2 1970)
  • burst scrobbles - exact artist/title with same timestamp only 1-2 seconds apart, more than 3 in a row

These are common problems with Last.fm datasets. These are shown with a sample of the Play affected on a Mirror's detail page

image

On a Job's export panel you can now decide how you want to address plays with data issues by

  • skipping bad timestamps
  • collapsing any set of burst scrobbles into one scrobble, so at least you have one good, valid scrobble to export
  • (dangerously) keep bad timestamps to pad playcounts, collapse all other burst scrobbles into one scrobble
image

Using skip bad timestamps and one play per burst is recommended. Be sure to read risks of dangerously keeping bad timestamps in the docs before using that option.

Other Changelog Highlights

⛰️ Features

  • (caa) Fallback to trying release group mbid if no art found for release #794
  • (ingress) Warn that ingress sources without a token, slug, or apiKey are deprecated
  • (ingress) Add per-Source maxBodySize option for LZ and LFM endpoint Sources

🐛 Bug Fixes

  • (listenbrainz) Map missing release_group_mbid from user listens to PlayObject credit #795
  • (listenbrainz) Use mapped artists when they fully explain submitted artist name #794
  • (subsonic) Store numeric playerId as a string deviceId #802 thanks @brennanneoh
  • (sonos) treat non-string duration and position as unknown #805 thanks @schmitzkr
  • (webscrobbler) Parse stateUpdatedAt as milliseconds #807

📚 Documentation

  • (jobs) Document job behavior on server restart #800 thanks @aitorres
  • (listenbrainz) Document mapping checks, conservative fallback and parse decisions
  • (No Category) Add sync status to atproto clients
  • (No Category) Add guidance for play state control during Jobs
  • (No Category) Add note about discarding plays via transform action