Giter Site home page Giter Site logo

Comments (7)

cgravolet avatar cgravolet commented on July 30, 2024

Hey Michael,

Thanks for the suggestion! I've got a few open source contributions I need to test before pushing out an update, I'll be sure this change gets in there.

Charles

On Aug 17, 2012, at 9:19 PM, Michael Mahemoff [email protected] wrote:

Hi, I'm the creator of Player FM, which a Scroblr contributor recently patched in support for. The way my player works is it's always present, but invisible, so Scroblr is sending an empty track on startup, and I suspect this may happen with other audio apps. My suggestion is to update pollSongInfo where it checks if it should send an update:

if (currentsong.name != song.name || currentsong.artist != song.artist)
I would suggest adding a check that $.trim(currentsong.name) isn't empty here. Alternatively, you may wish to default song name and artists to be '' (empty string) instead of 'undefined', though I think the aforementioned check is probably more robust (in case a value includes space characters for some reason).

โ€”
Reply to this email directly or view it on GitHub.

from scroblr.

cgravolet avatar cgravolet commented on July 30, 2024

Looking into this a little further, pollSongInfo uses the following selector to grab the artist:

artist = $('.permaplayer .meta .track-wrapper .title :first-child').text();

If you enter that in the console on the Player.fm homepage without playing a track, it returns the character "ยป". Furthermore , if you inspect the request that get's sent to Last.fm you'll notice those characters showing up as the track name / artist. I guess for some reason it's picking up the title/source seperator (ยป) as the first-child when the anchor tag is empty. I think the workaround would be to check first if the player was visible or perhaps if the title/source had a length greater than 1, otherwise return empty strings.

from scroblr.

mahemoff avatar mahemoff commented on July 30, 2024

I see. Actually it might be due to some update I made, but I think it's probably selecting too much.

Would you mind trying this:

artist: $('.permaplayer .meta .track-wrapper .current-series-link').text(),
name: $('.permaplayer .meta .track-wrapper .current-episode-link').text(),

for the Player FM entry? Combined with the check for zero-length string, it should work.

(I'd try myself, but I haven't set up the project for development. If this quick fix doesn't work, I'll set it up and work it out.)

from scroblr.

cgravolet avatar cgravolet commented on July 30, 2024

Hey, that's pretty much exactly what I did, then I noticed your reply :)

from scroblr.

mahemoff avatar mahemoff commented on July 30, 2024

Excellent, does that mean it worked? :)

from scroblr.

cgravolet avatar cgravolet commented on July 30, 2024

Yea, it seems to be working so far. I'd like to test it some more over the weekend and hopefully push out all these fixes on Sunday. Thanks for your help!

from scroblr.

mahemoff avatar mahemoff commented on July 30, 2024

Great, thanks for your help too. Looking forward to the update!

from scroblr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.