Skip to content

Conversation

@Lioncat6
Copy link

  • Added isrcs: Option<Vec<String>> to TrackResponse
  • Added new public methods submit_isrcs and get_track_by_isrc to track_repository
  • Added new private method get_isrcs_for_track to track_repository
  • Updated get_track_by_id, get_track_by_metadata, and get_tracks_by_keyword in track_repository to perform a lookup in the isrcs DB table after the first lookup in order to serve ISRCs in the TrackResponse
  • Updated add_one_tx, and add_one in track_repository to insert ISRCs into the isrcs table when provided
    • Now accepts isrcs field when adding new track entry
  • Added route /get/isrc/? at get_lyrics_by_isrc.rs
    • Accepts an ISRC
    • Uses the get_track_by_isrc method
  • Added route /submit-isrcs
    • Accepts isrcs and track_id as a payload
    • Requires a valid X-Publish-Token to submit an ISRC
      • POW rate limiting is bad but I'll make an issue about that later
  • Updated routes.rs with new routes
  • Updated lib.rs with new routes
  • Updated lib.rs to fix non-unix support
  • More things
    • Probably
    • Look at the diff

@Lioncat6
Copy link
Author

A new table in the DB was created for ISRCs, aptly named isrcs

This command can be used to add it to the DB

CREATE TABLE isrcs (
    isrc TEXT PRIMARY KEY,
    track_id INTEGER NOT NULL,
    FOREIGN KEY(track_id) REFERENCES tracks(id)
);

CREATE INDEX idx_isrcs_track_id ON isrcs(track_id);

It has two columns, one referencing a single isrc, and one referencing a single track_id
Should a track need more than one ISRC (as is the case for many songs), multiple isrcs can have the same track_id

@Lioncat6
Copy link
Author

Current Version

https://lrclib.net/api/get?artist_name=ivycomb&track_name=Synergy

{
  "id": 22783708,
  "name": "Synergy",
  "trackName": "Synergy",
  "artistName": "ivycomb",
  "albumName": "Rebirth",
  "duration": 227,
  "instrumental": false,
  "plainLyrics": "Being reborn as phoenix\nDoesn't make you synergize\nYou've gotta be someone better than yourself now\nThough it hurts, I sympathize\nYou can't tap into the echoes\nOf the past lives you have lived\nBut remembering you're better\nWill help you to the bitter end\n\nThe synergy\nLatent in me\nIt's crossed my lines, blinded my eyes\nA call for faith, from lands unknown\nTo cross the realms, and help us know\n\nThe synergy\nLatеnt in me\nIt's crossed my lines, blinded my eyes\nA call for faith, from lands unknown\nTo cross the realms, and help us know",
  "syncedLyrics": "[00:38.03] Being reborn as phoenix\n[00:41.08] Doesn't make you synergize\n[00:44.10] You've gotta be someone better than yourself now\n[00:47.49] Though it hurts, I sympathize\n[00:50.43] You can't tap into the echoes\n[00:53.86] Of the past lives you have lived\n[00:57.06] But remembering you're better\n[01:00.29] Will help you to the bitter end\n[01:02.74]\n[01:03.61] The synergy\n[01:06.78] Latent in me\n[01:09.74] It's crossed my lines, blinded my eyes\n[01:16.41] A call for faith, from lands unknown\n[01:22.58] To cross the realms, and help us know\n[01:30.18]\n[02:07.74] The synergy\n[02:10.60] Latеnt in me\n[02:13.72] It's crossed my lines, blinded my eyes\n[02:20.22] A call for faith, from lands unknown\n[02:26.67] To cross the realms, and help us know"
}

With ISRC Support

http://127.0.0.1:3300/api/get?artist_name=ivycomb&track_name=Synergy

{
  "id": 22783708,
  "name": "Synergy",
  "trackName": "Synergy",
  "artistName": "ivycomb",
  "albumName": "Rebirth",
  "duration": 227,
  "instrumental": false,
  "plainLyrics": "Being reborn as phoenix\nDoesn't make you synergize\nYou've gotta be someone better than yourself now\nThough it hurts, I sympathize\nYou can't tap into the echoes\nOf the past lives you have lived\nBut remembering you're better\nWill help you to the bitter end\n\nThe synergy\nLatent in me\nIt's crossed my lines, blinded my eyes\nA call for faith, from lands unknown\nTo cross the realms, and help us know\n\nThe synergy\nLatеnt in me\nIt's crossed my lines, blinded my eyes\nA call for faith, from lands unknown\nTo cross the realms, and help us know",
  "syncedLyrics": "[00:38.03] Being reborn as phoenix\n[00:41.08] Doesn't make you synergize\n[00:44.10] You've gotta be someone better than yourself now\n[00:47.49] Though it hurts, I sympathize\n[00:50.43] You can't tap into the echoes\n[00:53.86] Of the past lives you have lived\n[00:57.06] But remembering you're better\n[01:00.29] Will help you to the bitter end\n[01:02.74]\n[01:03.61] The synergy\n[01:06.78] Latent in me\n[01:09.74] It's crossed my lines, blinded my eyes\n[01:16.41] A call for faith, from lands unknown\n[01:22.58] To cross the realms, and help us know\n[01:30.18]\n[02:07.74] The synergy\n[02:10.60] Latеnt in me\n[02:13.72] It's crossed my lines, blinded my eyes\n[02:20.22] A call for faith, from lands unknown\n[02:26.67] To cross the realms, and help us know",
  "isrcs": [
    "QT4K52553596"
  ]
}

@Lioncat6
Copy link
Author

Lioncat6 commented Jul 27, 2025

New ISRC lookup endpoint

http://127.0.0.1:3300/api/get/isrc/QT4K52553596

{
  "id": 22783708,
  "name": "Synergy",
  "trackName": "Synergy",
  "artistName": "ivycomb",
  "albumName": "Rebirth",
  "duration": 227,
  "instrumental": false,
  "plainLyrics": "Being reborn as phoenix\nDoesn't make you synergize\nYou've gotta be someone better than yourself now\nThough it hurts, I sympathize\nYou can't tap into the echoes\nOf the past lives you have lived\nBut remembering you're better\nWill help you to the bitter end\n\nThe synergy\nLatent in me\nIt's crossed my lines, blinded my eyes\nA call for faith, from lands unknown\nTo cross the realms, and help us know\n\nThe synergy\nLatеnt in me\nIt's crossed my lines, blinded my eyes\nA call for faith, from lands unknown\nTo cross the realms, and help us know",
  "syncedLyrics": "[00:38.03] Being reborn as phoenix\n[00:41.08] Doesn't make you synergize\n[00:44.10] You've gotta be someone better than yourself now\n[00:47.49] Though it hurts, I sympathize\n[00:50.43] You can't tap into the echoes\n[00:53.86] Of the past lives you have lived\n[00:57.06] But remembering you're better\n[01:00.29] Will help you to the bitter end\n[01:02.74]\n[01:03.61] The synergy\n[01:06.78] Latent in me\n[01:09.74] It's crossed my lines, blinded my eyes\n[01:16.41] A call for faith, from lands unknown\n[01:22.58] To cross the realms, and help us know\n[01:30.18]\n[02:07.74] The synergy\n[02:10.60] Latеnt in me\n[02:13.72] It's crossed my lines, blinded my eyes\n[02:20.22] A call for faith, from lands unknown\n[02:26.67] To cross the realms, and help us know",
  "isrcs": [
    "QT4K52553596"
  ]
}

New ISRC submission endpoint

http://127.0.0.1:3300/api/submit-isrcs

Body:

{
   "isrcs": ["QT4K52553596"],
   "track_id": 22783708,
}
#### Responses
`201` - Submitted
`400` - `{"message":"The provided publish token is incorrect","name":"IncorrectPublishTokenError","statusCode":400}`

@itslukej
Copy link

"X-Publish-Token": "wJifPKyDTOXP92yVKy0AsOuQwd5WnKzV:28363520"

17 million tracks in the db, 1 isrc per track, 28363520 passes per isrc = 482 trillion sha256 passes

Can you make an antminer integration?

@Lioncat6
Copy link
Author

"X-Publish-Token": "wJifPKyDTOXP92yVKy0AsOuQwd5WnKzV:28363520"

17 million tracks in the db, 1 isrc per track, 28363520 passes per isrc = 482 trillion sha256 passes

Can you make an antminer integration?

Yeah... I was waiting for comments from the original author on a better way to do ratelimiting

POW rate limiting is bad but I'll make an issue about that later

Proof of work rate limiting is just bad on so many levels

I'm going to remove it for now

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.

2 participants