Skip to content
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

Add support for ListenBrainz Audio Scrobbler Service #1224

Closed
wants to merge 2 commits into from
Closed

Add support for ListenBrainz Audio Scrobbler Service #1224

wants to merge 2 commits into from

Conversation

ibmibmibm
Copy link
Contributor

  • Add textbox in user settings page for ListenBrainz token
  • Add changes to db
  • Add test for reading id
    • Add tag on testing file
  • Add localization entry

@ibmibmibm ibmibmibm closed this Sep 5, 2019
@ibmibmibm ibmibmibm reopened this Sep 5, 2019
@jvoisin jvoisin requested a review from eharris September 5, 2019 08:36
Copy link
Contributor

@jvoisin jvoisin left a comment

Choose a reason for hiding this comment

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

Nice and clean pull-request, thanks!

@ibmibmibm
Copy link
Contributor Author

Try to make changes for Java8 now...

Copy link
Contributor

@eharris eharris left a comment

Choose a reason for hiding this comment

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

Good clean PR, thanks!
Please add the help messages to the rest of the internationalization language files (in English if you don't know the language). The translations can be handled later.

@ibmibmibm
Copy link
Contributor Author

looks like #1218 ?

@eharris
Copy link
Contributor

eharris commented Sep 9, 2019

@ibmibmibm What does that ticket have to do with this?

@ibmibmibm
Copy link
Contributor Author

@ibmibmibm What does that ticket have to do with this?

Looks like that occurs in CI runs, too.

@eharris
Copy link
Contributor

eharris commented Sep 9, 2019

The CI runs do not use a media player, they just pull the stream directly from the API. We don't know yet why Travis is having issues, but there's no way that MEJS player issues are involved.

@eharris eharris added type: enhancement-closed What was previously labeled enhancement. For archiving. Will be organized later. type: request There is no implementer. Or there is no support from the maintainer. Please implement it and appeal. labels Sep 15, 2019
Copy link
Contributor

@eharris eharris left a comment

Choose a reason for hiding this comment

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

You probably want some other way to trigger retries if scrobbling fails, since there are now two different scrobble destinations. The way the logic is now, if one fails, both will get re-posted. I'm not sure if that would cause duplicate scrobbles on the one that didn't fail, but I'm sure the services would prefer not to get duplicate scrobble attempts just the same. So there should probably be either separate queues, or keep flags on the queued item that says which service needs retrying.

@eharris eharris added this to the 10.5.0 milestone Sep 16, 2019
@ibmibmibm ibmibmibm requested a review from eharris September 22, 2019 03:39
Copy link
Contributor

@eharris eharris left a comment

Choose a reason for hiding this comment

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

I didn't have time to fully review everything, but don't want to hold up you fixing the already identified issues, so going ahead and submitting now.

Copy link
Contributor

@fxthomas fxthomas left a comment

Choose a reason for hiding this comment

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

A few questions on how things work, but otherwise it sounds like a great PR.

(...and thank you for a feature I had been waiting for for a long time! 😉)

@ibmibmibm
Copy link
Contributor Author

I've separated AudioScrobblerService into two helper class, to handle different audio scrobbler target.

Copy link
Contributor

@fxthomas fxthomas left a comment

Choose a reason for hiding this comment

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

Good changes, thanks! But now that things are split, why not make a complete interface (something like ScrobblerInterface?) with consistent method signatures? This makes things even clearer!

}
lastFMScrobbler.register(mediaFile, userSettings.getLastFmUsername(), userSettings.getLastFmPassword(), submission, time);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better to pass uername and password through the constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this service construct one for every users? I was guessing that this service object shared between all users, so I passed this data through register function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see, if you see it as a long-running service that's shared for everyone it makes sense.

What do you think of turning it into a real Spring service then? IMO this makes it more clear that it's intended this way and avoids the if (lastFMScrobbler == null) dance a few lines above.

@eharris
Copy link
Contributor

eharris commented Oct 21, 2019

I'd really like to see this get merged soon. @ibmibmibm can you address @fxthomas concerns? I will also try to allocate time to review after that happens.

@eharris
Copy link
Contributor

eharris commented Oct 21, 2019

I've separated AudioScrobblerService into two helper class, to handle different audio scrobbler target.

We really appreciate your work on this, it's really shaping up well!

That being said, I'd really like to see the code rearrangement (moving Last.fm to its own helper class) done as a separate commit (or even its own PR) before the changes to add ListenBrainz.

@ibmibmibm
Copy link
Contributor Author

I've separated AudioScrobblerService into two helper class, to handle different audio scrobbler target.

We really appreciate your work on this, it's really shaping up well!

That being said, I'd really like to see the code rearrangement (moving Last.fm to its own helper class) done as a separate commit (or even its own PR) before the changes to add ListenBrainz.

Now in separated commits.

@fxthomas
Copy link
Contributor

Thank you, great job on building this! 😄 Aside from my last comment we should be good to go.

@eharris
Copy link
Contributor

eharris commented Nov 11, 2019

This has a merge conflict that needs to be resolved.

- Split AudioScrobblerSevice into two classes
- Change api to https in last.fm Audio Scrobbler

Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
- Add textbox in user settings page for ListenBrainz token
- Add changes to db
    - Add db colume to store MusicBrainz Recording ID
    - Add db colume to store ListenBrainz token
- Add test for reading id
    - Add tag on testing file
- Add localization entry

Signed-off-by: Shen-Ta Hsieh <ibmibmibm.tw@gmail.com>
@muff1nman
Copy link
Contributor

Merged in 84df4e3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement-closed What was previously labeled enhancement. For archiving. Will be organized later. type: request There is no implementer. Or there is no support from the maintainer. Please implement it and appeal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants