Giter Club home page Giter Club logo

Comments (12)

jcorporation avatar jcorporation commented on June 14, 2024 1

I could replicate your issue, it occurs only if the MUSICBRAINZ_ALBUMID tag is not enabled. Above commit fixes it in my environment.

Please test.

from mympd.

jcorporation avatar jcorporation commented on June 14, 2024

I can not reproduce your issue.
Are there more errors in the Web Developer Tools Console?

Edit: commit a803a24 improves the logging of javascript errors. Please pull latest devel version.

from mympd.

Ezka77 avatar Ezka77 commented on June 14, 2024

I've this kind of messages in the browser console using the HEAD of devel:
For the first TypeError:

18:19:25,787 DEBUG: Websocket notification: {"jsonrpc":"2.0","method":"update_state","params":{"state":"play","volume":70,"songPos":8,"elapsedTime":0,"totalTime":199,"currentSongId":10,"kbitrate":128,"queueLength":12,"queueVersion":18,"nextSongPos":9,"nextSongId":11,"lastSongId":9,"partition":"default","AudioFormat":{"sampleRate":44100,"bits":224,"channels":2},"updateState":0,"updateCacheState":false,"lastError":""}} combined.js:4291:30
18:19:25,787 DEBUG: Send API request: MYMPD_API_PLAYER_CURRENT_SONG combined.js:4291:30
18:19:25,787 DEBUG: Set mediaSession.playbackState to playing combined.js:4291:30
18:19:25,957 DEBUG: Got API response of type: MYMPD_API_PLAYER_CURRENT_SONG combined.js:4291:30
18:19:25,957 DEBUG: Calling parseCurrentSong combined.js:4291:30
18:19:25,958 DEBUG: getData: "uri":"/albumart?offset=0&uri=Caroline%20Polachek%2FDesire%2C%20I%20Want%20to%20Turn%20Into%20You%2F08%20Blood%20and%20Butter.m4a" 3 combined.js:4291:30
18:19:25,962 Uncaught TypeError: text is undefined
    elCreateText https://192.168.0.100/js/combined.js:6474
    getMBtagLink https://192.168.0.100/js/combined.js:8774
    addMusicbrainzFields https://192.168.0.100/js/combined.js:8799
    setPlaybackCardTags https://192.168.0.100/js/combined.js:18749
    parseCurrentSong https://192.168.0.100/js/combined.js:18666
    onreadystatechange https://192.168.0.100/js/combined.js:13215
combined.js:6474:9

And here for the second one:

18:14:44,394 DEBUG: Browser tab gots the focus -> update player state combined.js:4291:30
18:14:44,394 DEBUG: Send API request: MYMPD_API_PLAYER_STATE combined.js:4291:30
18:14:44,459 DEBUG: getData: "href":"{"cmd": "clickPlay", "options": []}" combined.js:4291:30
18:14:44,462 Uncaught TypeError: uri is undefined
    isStreamUri https://192.168.0.100/js/combined.js:9490
    clickPlay https://192.168.0.100/js/combined.js:9095
    parseCmd https://192.168.0.100/js/combined.js:7771
    parseCmdFromJSON https://192.168.0.100/js/combined.js:7723
    appInit https://192.168.0.100/js/combined.js:24019
combined.js:9490:9

from mympd.

Ezka77 avatar Ezka77 commented on June 14, 2024

I've check with another album both are tagged with MBZ, here the error (looks the same to mee but 🤷‍♂️) :

18:29:52,444 DEBUG: Browser tab gots the focus -> update player state combined.js:4291:30
18:29:52,445 DEBUG: Send API request: MYMPD_API_PLAYER_STATE combined.js:4291:30
18:29:52,538 DEBUG: getData: "href":"[object Object]" combined.js:4291:30
18:29:52,540 DEBUG: Send API request: MYMPD_API_DATABASE_ALBUM_DETAIL combined.js:4291:30
18:29:52,616 DEBUG: Got API response of type: MYMPD_API_PLAYER_STATE combined.js:4291:30
18:29:52,616 DEBUG: Calling parseState combined.js:4291:30
18:29:52,616 DEBUG: Set mediaSession.playbackState to playing combined.js:4291:30
18:29:52,764 DEBUG: Got API response of type: MYMPD_API_DATABASE_ALBUM_DETAIL combined.js:4291:30
18:29:52,765 DEBUG: Calling parseAlbumDetails combined.js:4291:30
18:29:52,766 Uncaught TypeError: text is undefined
    elCreateText https://192.168.0.100/js/combined.js:6474
    getMBtagLink https://192.168.0.100/js/combined.js:8774
    addMusicbrainzFields https://192.168.0.100/js/combined.js:8799
    parseAlbumDetails https://192.168.0.100/js/combined.js:15171
    onreadystatechange https://192.168.0.100/js/combined.js:13215
combined.js:6474:9
18:29:54,082 DEBUG: Got websocket pong combined.js:4291:30

from mympd.

jcorporation avatar jcorporation commented on June 14, 2024

Please test if above commit fixes your issues.

from mympd.

jcorporation avatar jcorporation commented on June 14, 2024

Please attach your mpd and myMPD configuration (enabled tags are interesting). I would like to reproduce the issue.

from mympd.

Ezka77 avatar Ezka77 commented on June 14, 2024

The error on "toggle play" button seems fixed, but the first TypeError is still here.

For MPD, with all my finesse 😁, I've enable all the metadata that I can find:

metadata_to_use "albumartist,artist,album,title,track,name,genre,date,disc,albumartistsort,MUSICBRAINZ_ALBUMARTISTID,MUSICBRAINZ_ARTISTID,MUSICBRAINZ_RELEASETRACKID,MUSICBRAINZ_RELEASETRACKID"

Here the full configuration file:
mpd.log

And on mympd same idea:
mympd settings

I've try keeping only the "artist" tag in mympd UI but still I get the same issue even with no tags enabled (but I like this clean UI though)
no tags

from mympd.

jcorporation avatar jcorporation commented on June 14, 2024

Same error in the browser console? The JavaScript stacktrace is always interesting. Any errors in the myMPD log (set it to debug)?

Occurs this error also in other browsers?

from mympd.

Ezka77 avatar Ezka77 commented on June 14, 2024

Server side a JSON message seems truncated, the uri part (if the log is not truncated itself):

May 29 09:39:53 sparrow daemon.debug mympd: "default": Got API response for id "32"
May 29 09:39:53 sparrow daemon.debug mympd: "default": Sending response to conn_id 32 (length: 4336): {"jsonrpc":"2.0","id":0,"result":{"method":"MYMPD_API_DATABASE_ALBUM_DETAIL","data":[{"Type": "song","Track":"1","Title":"Welcome to My Island","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":233,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/01 Welcome to My Island.m4a"},{"Type": "song","Track":"2","Title":"Pretty in Possible","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":216,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/02 Pretty in Possible.m4a"},{"Type": "song","Track":"3","Title":"Bunny Is a Rider","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":194,"LastModified":1683314364,"uri":"Caroline Polachek/De
May 29 09:39:53 sparrow daemon.debug mympd: Sending 4336 bytes to 32
May 29 09:40:01 sparrow daemon.debug mympd: "default": Websocket message (18): ping

And the corresponding message in Firefox JS console:

09:38:15,722 Uncaught TypeError: text is undefined
    elCreateText https://192.168.0.100/js/combined.js:6474
    getMBtagLink https://192.168.0.100/js/combined.js:8775
    addMusicbrainzFields https://192.168.0.100/js/combined.js:8800
    parseAlbumDetails https://192.168.0.100/js/combined.js:15175
    onreadystatechange https://192.168.0.100/js/combined.js:13219
combined.js:6474:9

And with Chrome the error seems to have some more intel about lenght:

combined.js:6474 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at elCreateText (combined.js:6474:14)
    at getMBtagLink (combined.js:8775:16)
    at addMusicbrainzFields (combined.js:8800:31)
    at parseAlbumDetails (combined.js:15175:21)
    at ajaxRequest.onreadystatechange (combined.js:13219:17)
elCreateText @ combined.js:6474
getMBtagLink @ combined.js:8775
addMusicbrainzFields @ combined.js:8800
parseAlbumDetails @ combined.js:15175
ajaxRequest.onreadystatechange @ combined.js:13219
XMLHttpRequest.send (async)
sendAPIpartition @ combined.js:13226
sendAPI @ combined.js:13092
handleBrowseDatabaseAlbumDetail @ combined.js:14725
appRoute @ combined.js:23796
appGoto @ combined.js:23679
(anonymous) @ combined.js:14772

from mympd.

jcorporation avatar jcorporation commented on June 14, 2024

Log is truncated to 1023 bytes. The browser should show the full response in the network tab.

On a truncated response, the browser should throw a json parser error.

from mympd.

Ezka77 avatar Ezka77 commented on June 14, 2024

Right the response is not truncated:

{"jsonrpc":"2.0","id":0,"result":{"method":"MYMPD_API_DATABASE_ALBUM_DETAIL","data":[{"Type": "song","Track":"1","Title":"Welcome to My Island","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":233,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/01 Welcome to My Island.m4a"},{"Type": "song","Track":"2","Title":"Pretty in Possible","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":216,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/02 Pretty in Possible.m4a"},{"Type": "song","Track":"3","Title":"Bunny Is a Rider","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":194,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/03 Bunny Is a Rider.m4a"},{"Type": "song","Track":"4","Title":"Sunset","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":163,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/04 Sunset.m4a"},{"Type": "song","Track":"5","Title":"Crude Drawing of an Angel","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":209,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/05 Crude Drawing of an Angel.m4a"},{"Type": "song","Track":"6","Title":"I Believe","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":247,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/06 I Believe.m4a"},{"Type": "song","Track":"7","Title":"Fly to You","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":245,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/07 Fly to You.m4a"},{"Type": "song","Track":"8","Title":"Blood and Butter","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":267,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/08 Blood and Butter.m4a"},{"Type": "song","Track":"9","Title":"Hopedrunk Everasking","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":199,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/09 Hopedrunk Everasking.m4a"},{"Type": "song","Track":"10","Title":"Butterfly Net","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":276,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/10 Butterfly Net.m4a"},{"Type": "song","Track":"11","Title":"Smoke","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":177,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/11 Smoke.m4a"},{"Type": "song","Track":"12","Title":"Billions","Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"Date":"2023-04-23","Name":"-","Disc":"1","Duration":297,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/12 Billions.m4a"}],"bookletPath":"","images": ["/browse/music/Caroline Polachek/Desire, I Want to Turn Into You/cover.jpg"],"embeddedImageCount":0,"returnedEntities":12,"Artist":["Caroline Polachek","Caroline Polachek feat. Grimes and Dido"],"Album":"Desire, I Want to Turn Into You","AlbumArtist":["Caroline Polachek"],"AlbumArtistSort":["Polachek, Caroline"],"Genre":["-"],"Date":"2023-04-23","Disc":"1","MUSICBRAINZ_ARTISTID":["d8f43dc5-4613-48ac-8c23-a62b82f8c67a"],"MUSICBRAINZ_ALBUMARTISTID":["d8f43dc5-4613-48ac-8c23-a62b82f8c67a"],"Duration":2723,"LastModified":1683314364,"uri":"Caroline Polachek/Desire, I Want to Turn Into You/01 Welcome to My Island.m4a","Discs":1,"SongCount":12,"lastPlayedSong":{"time":0,"uri":""}}}

Here the full JS log if it helps, quite easier to save it with Chrome (or I didn't find the right way to do it with firefox):
mympd_errors.log

and the debug log on mympd server:
mympd_server.log

from mympd.

Ezka77 avatar Ezka77 commented on June 14, 2024

Works for me too 👍 nice job !

from mympd.

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.