Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setlist.fm OpenScrobbler Option #248

Merged
merged 17 commits into from
Dec 27, 2024

Conversation

seankolczynski
Copy link
Contributor

@seankolczynski seankolczynski commented Aug 6, 2024

Goal

The aim of this project is to add Setlist.fm as a source for scrobbling on OpenScrobbler. This would behave in the pattern of Albums, with the flow of search, select, and scrobble for the desired tracks.

What's Setlist.fm?

Setlist.fm is an wiki for tracking live music performances. Populated mainly by user volunteers, a setlist is simply a list of songs performed by an artist during a concert. Information like Date/Time, Venue, live/tape, covers, and even individual sets are tracked. All of this data is available via their free API.

In the same way that a Last.fm user may want to scrobble an offline album, they may want to track music they saw live in concert.

Design

Screenshot 2024-08-21 at 5 52 23 PM A "Setlist" option will be added to the home page. Clicking it will take the user to a search bar, where they can search for their desired set. At the moment, this is actually an "input" bar, where the user needs to give the exam setlist.fm url. This url always has a UUID for each setlist, so we can literally rip that from the address. In the future, it could be nice to allow the user to search recent setlists from a specific artist/venue directly in OpenScrobbler, but for now I find this flow to be convenient enough

Once the search is run, a landing page similar to the "Album" page will be brought up. The list of songs is presented, and the user can select specific ones, or just scrobble the whole setlist.

Requirements

This project will require

  • the addition of a new outbound call to setlist.fm's API, to obtain all the setlist info
  • Addition of ability to search specific tracks on discogs of lastfm. Since concerts aren't as structured as an Album, if we need specific info on a song (i.e. duration), we will need to search for that
  • A few new components, though again, the album flow is going to be mimicked, and common components will be used when possible

Initial phase complete

Screenshot 2024-10-24 at 3 09 24 PM

With this change, a user can now

  • Load a setlist via a setlist.fm URL
  • Chose to scrobble the entire setlist, or select specific songs
    Some fine details of note:
  • The date of scrobble is preset to the date of the set. Setlist.fm API doesn't provide the time of the set, so that is left up to the user
  • If an artist performed a cover, the original artist will be credited in the Scrobble

Future improvements

  • One shortcoming of this current design is the scrobbles don't currently include an album. It wouldn't be too hard to add in theory, but given the current state of the Tracklist.tsx file, and the comment I noticed about it needing a refactor, I decided to hold off. The work I would do would be shoe-horned into code that is already asking to be changed. Perhaps I can help with that refactor in the near future
  • The UI is also fairly simple, and could probably be improved. Happy to put in more work if requested by reviews!

Language files

@elamperti pointed out that I don't actually have to write these, so I can remove my edits if you like!

@@ -1,5 +1,5 @@
import { Row } from 'reactstrap';
import { faCompactDisc, faPencilAlt, faUserFriends } from '@fortawesome/free-solid-svg-icons';
import { faCompactDisc, faPencilAlt, faUserFriends, faList } from '@fortawesome/free-solid-svg-icons';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elamperti
Copy link
Owner

Hi! This is great work, thanks for your effort! I'll be trying it soon to see how it's going so far, let me know when it's ready for review 😁

@seankolczynski
Copy link
Contributor Author

Hi! This is great work, thanks for your effort! I'll be trying it soon to see how it's going so far, let me know when it's ready for review 😁

thanks for the reply! this is still a WIP, I just like having the PR to kinda view my changes. I'll reach out if I have questions or when it's actually functional! :)

@seankolczynski seankolczynski changed the title Seank/setlist fm WIP! Seank/setlist fm Aug 9, 2024
@seankolczynski seankolczynski changed the title WIP! Seank/setlist fm WIP! Setlist.fm OpenScrobbler Option Aug 21, 2024
@@ -25,6 +25,7 @@
"yourHistory": "Ваша історія",
"scrobbleManually": "Скробблити вручну",
"scrobbleFromOtherUser": "Скробблити за іншим користувачем",
"scrobbleFromSetlist": "Скробблити зі списку",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest "Скробблити з setlist", to emphasize that user's going to scrobble from a service called "setlist". Otherwise in the current form it basically says "scrobble from a list", which makes too little sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip! If it wasn't obvious these were all just google translate attempts so I appreciate real human help! :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, the project translations are handled through POEditor, so don't worry too much about it for the moment. Everyone will be able to contribute and improve translations once we add them there!

@seankolczynski seankolczynski marked this pull request as ready for review October 24, 2024 19:10
@seankolczynski seankolczynski changed the title WIP! Setlist.fm OpenScrobbler Option Setlist.fm OpenScrobbler Option Oct 24, 2024
@elamperti
Copy link
Owner

Hi, thanks for your patience! I was traveling and unable to check this out properly. I've started testing it locally now, looks good! There are a few things to adjust but nothing too bad 😅

I may push some changes to the branch, and I'll leave some comments after reviewing it more thoroughly.

@elamperti elamperti removed the request for review from ozahorulia December 14, 2024 15:52
@elamperti
Copy link
Owner

I'm still working on this, I've added the missing search functionality and ironing out the last details now. I'll try to release it before Christmas 🎄

image

Copy link
Owner

@elamperti elamperti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, you did a great job with this PR! Thanks a lot for your contribution to the project! I'll push my improvements on this branch and merge all together. A new release of the scrobbler with this functionality will be out shortly 😃

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this file I ended up doing a small refactor to simplify it, remove some unused variables and break the line that sets header into multiple lines for readability.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added functionality to search by artist name

src/Constants.ts Outdated
@@ -6,6 +6,7 @@ export const LASTFM_AUTH_URL =
`&cb=${window.location.protocol}//${window.location.host}/lastfm/callback/`;
export const PATREON_AUTH_URL = `https://www.patreon.com/oauth2/authorize?response_type=code&client_id=${process.env.REACT_APP_PATREON_CLIENT_ID}&redirect_uri=${window.location.protocol}//${process.env.REACT_APP_HOST}/patreon/callback`;
export const OPENSCROBBLER_API_URL = '/api/v2';
export const SETLISTFM_API_URL = '/api/v2/setlistfm.php';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just using OPENSCROBBLER_API_URL, at least for now, so there was no use for it here. Using a different URL -e.g. hitting setlist.fm directly- would require some other changes anyway.

src/Constants.ts Outdated
@@ -14,18 +15,23 @@ export const MAX_SCROBBLES_PER_REQUEST = 50;
export const MAX_RECENT_USERS = 6;
export const MAX_RECENT_ALBUMS = 8;
export const DEFAULT_SONG_DURATION = 3 * 60; // ToDo: use this value when skipping time forward after scrobble
// Live music is unpredictable, but usually the band takes a few seconds to breathe / introduce song.
// Adding some leeway to encapsulate this, but it will never be perfect.
export const DEFAULT_CONCERT_SONG_BUFFER = 60;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: renamed this constant to DEFAULT_CONCERT_INTERVAL_DURATION, as buffer may be confused with data/streaming terms.

@elamperti elamperti merged commit 79a8f95 into elamperti:main Dec 27, 2024
@seankolczynski
Copy link
Contributor Author

Ahhhh Sorry for going dark on this!! Thanks for your additions and for pushing it through there

@elamperti
Copy link
Owner

No worries, it took me a bit of time to get back to it. I hope you find my changes useful! Thanks once again for this contribution 🙏🏼

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.

3 participants