Home of the Squeezebox™ & Transporter® network music players.
Page 584 of 620 FirstFirst ... 84484534574582583584585586594 ... LastLast
Results 5,831 to 5,840 of 6193
  1. #5831
    Senior Member
    Join Date
    Mar 2017
    Posts
    2,450
    Quote Originally Posted by afriend View Post
    Hey @cpd73:

    I wrote a simple rating plugin called Ratings Light. It would be nice to see Material enable ratings when this plugin is installed. Please let me know if you're planning to add support.
    As stated before, Material uses the TrackStat API to set ratings. So, you need to mimic this.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

  2. #5832
    Senior Member
    Join Date
    Mar 2017
    Posts
    2,450
    Quote Originally Posted by awetmore View Post
    When I posted last night I was testing through albums in my favorites (the albums happen to come from Spotty), and it doesn't work when I'm there. I do see it working when I'm going through my library (both on Spotty and local music).
    Ah! Yes, you are correct. Will fix for 2.1.0 - thanks for reporting.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

  3. #5833
    Senior Member
    Join Date
    Jul 2010
    Posts
    163
    Quote Originally Posted by cpd73 View Post
    As stated before, Material uses the TrackStat API to set ratings. So, you need to mimic this.
    It does "mimic" the TrackStat API (as the linked code shows) in all except, of course, the plugin name: ['ratingslight', 'setrating', '_trackid', '_rating'].

  4. #5834
    Junior Member
    Join Date
    Oct 2005
    Posts
    22

    Remove from Favorites doesn't work

    "Remove from Favorites" isn't working for me on network stream items. This is on 2.0.0.

    I worked around this by temporarily using the classic skin.

    Repro:
    * Create Favorite using + in heart. Name "test", URL "http://google.com".
    * Remove Favorite
    * I get "Network Error"

    Here is the console log:
    Network Error (3) ["favorites", "delete", "http://google.com"]0: "favorites"1: "delete"2: "http://google.com"length: 3__proto__: Array(0)
    logError @ material.min.js?r=2.0.2:229
    logAndShowError @ material.min.js?r=2.0.2:229
    (anonymous) @ material-deferred.min.js?r=2.0.2:144
    Promise.catch (async)
    (anonymous) @ material-deferred.min.js?r=2.0.2:144
    Promise.then (async)
    browseItemAction @ material-deferred.min.js?r=2.0.2:143
    itemAction @ material.min.js?r=2.0.2:342
    click @ VM25:3
    He @ material.min.js?r=2.0.2:69
    n @ material.min.js?r=2.0.2:69
    He @ material.min.js?r=2.0.2:69
    e.$emit @ material.min.js?r=2.0.2:69
    click @ material.min.js?r=2.0.2:75
    He @ material.min.js?r=2.0.2:69
    n @ material.min.js?r=2.0.2:69
    Yr.o._wrapper @ material.min.js?r=2.0.2:69
    material.min.js?r=2.0.2:229 console.trace
    logError @ material.min.js?r=2.0.2:229
    logAndShowError @ material.min.js?r=2.0.2:229
    (anonymous) @ material-deferred.min.js?r=2.0.2:144
    Promise.catch (async)
    (anonymous) @ material-deferred.min.js?r=2.0.2:144
    Promise.then (async)
    browseItemAction @ material-deferred.min.js?r=2.0.2:143
    itemAction @ material.min.js?r=2.0.2:342
    click @ VM25:3
    He @ material.min.js?r=2.0.2:69
    n @ material.min.js?r=2.0.2:69
    He @ material.min.js?r=2.0.2:69
    e.$emit @ material.min.js?r=2.0.2:69
    click @ material.min.js?r=2.0.2:75
    He @ material.min.js?r=2.0.2:69
    n @ material.min.js?r=2.0.2:69
    Yr.o._wrapper @ material.min.js?r=2.0.2:69

  5. #5835
    Senior Member
    Join Date
    Mar 2017
    Posts
    2,450
    Quote Originally Posted by awetmore View Post
    "Remove from Favorites" isn't working for me on network stream items.
    Already reported.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

  6. #5836
    Senior Member
    Join Date
    Mar 2017
    Posts
    2,450
    Quote Originally Posted by afriend View Post
    It does "mimic" the TrackStat API (as the linked code shows) in all except, of course, the plugin name: ['ratingslight', 'setrating', '_trackid', '_rating'].
    OK, in git/master (for 2.1.0) I have added (untested) support for this. To detect the plugin I call ["can", "trackstat", "getrating", "?"] for TrackStat. If this returns "_can:1" then TrackStat is used. Otherwise I call ["can", "ratingslight", "getrating", "?"] to check for ratingslight. This also needs to return "_can:1" If it does, I then call ["pref", "plugin.ratingslight:rating_10scale", "?"] to check the rating scale. This should return 1 if 10 is max rating, otherwise 5 is assumed.

    [Edit] So, basically if all "trackstat" ratings used by Material map onto "ratingslight" then it should work...
    Last edited by cpd73; 2020-11-30 at 14:43.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

  7. #5837
    Senior Member
    Join Date
    Jul 2010
    Posts
    163
    Quote Originally Posted by cpd73 View Post
    OK, in git/master (for 2.1.0) I have added (untested) support for this. To detect the plugin I call ["can", "trackstat", "getrating", "?"] for TrackStat. If this returns "_can:1" then TrackStat is used. Otherwise I call ["can", "ratingslight", "getrating", "?"] to check for ratingslight. This also needs to return "_can:1" If it does, I then call ["pref", "plugin.ratingslight:rating_10scale", "?"] to check the rating scale. This should return 1 if 10 is max rating, otherwise 5 is assumed.

    [Edit] So, basically if all "trackstat" ratings used by Material map onto "ratingslight" then it should work...
    Ratings Light doesn't have a getrating function/dispatch because it assumes that plugins and apps like Material fetch ratings directly from LMS using tags:R.
    Code:
    lmsCommand("", ["can", "ratingslight", "setrating", "?"]).then(({data}) => {console.log(JSON.stringify(data));});
    "can" query for setrating returns "_can":1 for Ratings Light (same for TrackStat).

    Ratings Light expects rating values between 0 and 5. Half-star ratings like 3.5 are also supported and passed on to the LMS persistent database. I suppose that should work because it did when I still faked the TrackStat API while I was testing the plugin.


    The current Material master version doesn't display any ratings for me, not even if I fake the TrackStat API. If I take the store.js code (580-594) from the previous 2.1 branch and replace ["can", "trackstat", "getrating", "?"] with ["can", "ratingslight", "setrating", "?"] Material will display ratings.

  8. #5838
    Senior Member
    Join Date
    Mar 2017
    Posts
    2,450
    Quote Originally Posted by afriend View Post
    "can" query for setrating returns "_can":1 for Ratings Light (same for TrackStat).
    Thanks, I've changed the code to do this.

    Quote Originally Posted by afriend View Post
    The current Material master version doesn't display any ratings for me, not even if I fake the TrackStat API. If I take the store.js code (580-594) from the previous 2.1 branch and replace ["can", "trackstat", "getrating", "?"] with ["can", "ratingslight", "setrating", "?"] Material will display ratings.
    Yeah, TrackStat appears to be acting odd. I've just seen it accept an update, and then I went through a phase where it would accept the API call, but the rating was not set. Now it seems to be back OK. Not sure if LMS was busy refreshing the DB, or something when the setrating failed. Anyhow, you can see the messages Material is sending to confirm the call is valid.

    However, please update and try again.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

  9. #5839
    Senior Member
    Join Date
    Jul 2010
    Posts
    163
    Quote Originally Posted by cpd73 View Post
    However, please update and try again.
    Just tested the latest. Still no ratings displayed. Console says:

    Code:
    [Error] Unhandled Promise Rejection: TypeError: plugins.shift is not a function. (In 'plugins.shift()', 'plugins.shift' is undefined)
    	setRatingsPlugin (store.js:204)
    	(anonymous function) (store.js:218)
    	promiseReactionJob
    Probably unrelated, 2 resources reported 404 in material/html/lib:
    axios.min.map
    vue-virtual-scroller.min.js.map
    Last edited by afriend; 2020-12-01 at 11:43.

  10. #5840
    Senior Member
    Join Date
    Mar 2017
    Posts
    2,450
    Quote Originally Posted by afriend View Post
    Just tested the latest. Still no ratings displayed. Console says:

    Code:
    [Error] Unhandled Promise Rejection: TypeError: plugins.shift is not a function. (In 'plugins.shift()', 'plugins.shift' is undefined)
    	setRatingsPlugin (store.js:204)
    	(anonymous function) (store.js:218)
    	promiseReactionJob
    Ah! Oops! I don't have your plugin installed, but do have trackstat - so it stops there. Please update once more.

    Quote Originally Posted by afriend View Post
    Probably unrelated, 2 resources reported 404 in material/html/lib:
    axios.min.map
    vue-virtual-scroller.min.js.map
    Ignore those, I don't ship .map files.
    Material debug: 1. Launch via http: //SERVER:9000/material/?debug=json (Use http: //SERVER:9000/material/?debug=json,cometd to also see update messages, e.g. play queue) 2. Open browser's developer tools 3. Open console tab in developer tools 4. REQ/RESP messages sent to/from LMS will be logged here.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •