Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 5 of 5

Thread: favorite id

  1. #1

    favorite id

    Hi,

    i request favorites with the following parameters from my LMS with JSON/RPC

    Code:
    {"id":1,"method":"slim.request","params":["",["favorites","items","0","100","want_url:1"]]}
    as a result i get the following.
    Where is the red marked ID in the slim server calculated?
    With each the request, the key before the dot changes.

    i looked allready in the following files:
    Slim/Plugin/Favorites/OpmlFavorites.pm
    Slim/Control/XMLBrowser.pm
    Slim/Plugin/Favorites/Plugin.pm



    Code:
    {
        "params": [
            "",
            [
                "favorites",
                "items",
                "0",
                "100",
                "want_url:1"
            ]
        ],
        "id": 1,
        "result": {
            "count": "13",
            "loop_loop": [
                {
                    "id": "6797988f.0",
                    "name": "Baraza+Radio",
                    "type": "audio",
                    "image": "https://static-media.streema.com/media/cache/c7/c0/c7c0f0ec0d30e31f767a66d9885a6142.jpg",
                    "url": "http://50.7.77.114:8101/;",
                    "isaudio": 1,
                    "hasitems": 0
                },
                {
    --snip--

  2. #2
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,294

    favorite id

    > Where is the red marked ID in the slim server calculated?

    I thought it was in XMLBrowser.

    The ID there is more of a menu item ID than a favorite ID. What are you
    trying to do?
    --

    Michael

  3. #3
    i want to remove the cryptic part of the id, but i dont know the rules to recognize it savely.

    to test i have following javascript-code. it relies on that the cryptic part ist not a number,
    if the id is a hex-value it can also be a number.
    i want to look for the rules to generate the id, to identify the rules.

    Code:
    var key1 = "65b04304.1";
    var key2 = "12";
    var key3 = "12.1";
    var key4 = "12.1.2.3"
    
    var res1,res2,res3,res4;
    debugger;
    res1=test(key1);
    res2=test(key2);
    res3=test(key3);
    res4=test(key4);
    
    function test(id) {
      var pos = id.indexOf(".");
      if (isNaN(id.substr(1,pos))) {
        return id.substr(pos+1);
      } else {
        return id;
      }
    }

  4. #4
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,294

    favorite id

    > i want to remove the cryptic part of the id, but i dont know the rules
    > to recognize it savely.


    Then just remove it :-). But what is it you really want to do? Removing
    that ID value is not something anyone would want to do without a
    purpose, is it?

    --

    Michael

  5. #5
    ok more details.
    the cryptic id before the dot is not needed.
    the real id for the favorite ist after the dot.
    with this id i can start playing the favorite

    but

    the added cryptic id is only given if you request the first level of the favorite.
    if you request the favorites from a deeper level (or subirectory), then there is no cryptic id like "id": "12.1.0"
    so i want to remove it.

    i have found the creation of this id. the cryptic part was a session-id and this was created based on a sha_hex function cutted to 8 chars.
    now i have my rule to remove

Posting Permissions

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