Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video duplicated in playlist #66

Closed
regseb opened this issue Apr 6, 2022 · 3 comments · Fixed by #70
Closed

Video duplicated in playlist #66

regseb opened this issue Apr 6, 2022 · 3 comments · Fixed by #70
Assignees
Labels
bug Something isn't working
Milestone

Comments

@regseb
Copy link

regseb commented Apr 6, 2022

Describe the bug

When you add a video with JSON-RPC, the video is duplicated in the playlist.

To Reproduce

  1. In Kodi, Allow remote control via HTTP (Settings / Services / Control).
  2. Execute (by changing the IP address):
  3. curl -d '{ "jsonrpc": "2.0", "method": "Playlist.Clear", "params": { "playlistid": 1 }, "id": 1 }' -H 'Content-type: application/json' -X POST 127.0.0.1:8080/jsonrpc
{ "id": 1, "jsonrpc": "2.0", "result": "OK" }
  1. curl -d '{ "jsonrpc": "2.0", "method": "Playlist.Add", "params": { "playlistid": 1, "item": { "file": "plugin://plugin.video.vimeo/play/?video_id=306834650" } }, "id": 2 }' -H 'Content-type: application/json' -X POST 127.0.0.1:8080/jsonrpc
{ "id": 2, "jsonrpc": "2.0", "result": "OK" }
  1. curl -d '{ "jsonrpc": "2.0", "method": "Playlist.GetItems", "params": { "playlistid": 1, "properties": ["file"] }, "id": 3 }' -H 'Content-type: application/json' -X POST 127.0.0.1:8080/jsonrpc
{
    "id": 3,
    "jsonrpc": "2.0",
    "result": {
        "items": [{
            "file": "plugin://plugin.video.vimeo/play/?video_id=306834650",
            "label": "play",
            "type": "unknown"
        }],
        "limits": { "end": 1, "start": 0, "total": 1 }
    }
}
  1. curl -d '{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "playlistid": 1 } }, "id": 4 }' -H 'Content-type: application/json' -X POST 127.0.0.1:8080/jsonrpc
{ "id": 4, "jsonrpc": "2.0", "result": "OK" }
  1. curl -d '{ "jsonrpc": "2.0", "method": "Playlist.GetItems", "params": { "playlistid": 1, "properties": ["file"] }, "id": 5 }' -H 'Content-type: application/json' -X POST 127.0.0.1:8080/jsonrpc
{
    "id": 5,
    "jsonrpc": "2.0",
    "result": {
        "items": [{
            "file": "plugin://plugin.video.vimeo/play/?video_id=306834650",
            "label": "play",
            "type": "unknown"
        }, {
            "file": "plugin://plugin.video.vimeo/play/?uri=%2Fvideos%2F306834650&texttracks=",
            "label": "Eddy De Pretto - Random",
            "type": "unknown"
        }],
        "limits": {"end": 2, "start": 0, "total": 2 }
    }
}

Environment

  • Kodi version: 19.4
  • OSMC version: 2022.03-1
  • Vimeo add-on version: 6.0.1

Additional info

This is the first video that is played: curl -d '{ "jsonrpc": "2.0", "method": "Player.GetProperties", "params": { "playerid": 1, "properties": ["position"] }, "id": 6 }' -H 'Content-type: application/json' -X POST 127.0.0.1:8080/jsonrpc

{ "id": 6, "jsonrpc": "2.0", "result": { "position": 0 } }
@jaylinski jaylinski self-assigned this Apr 6, 2022
@jaylinski jaylinski added the bug Something isn't working label Apr 6, 2022
@jaylinski jaylinski added this to the v6.1.0 milestone Apr 6, 2022
jaylinski added a commit that referenced this issue Apr 26, 2024
When a video is shared with this addon, it can be
done by calling `Playlist.Add` or `Player.Open`.
If it is done via `Playlist.Add`, the item is already
in a playlist, so we don't have to do it ourselves.
If it is done via `Player.Open`, the user probably
doesn't want to create a playlist at all.

Resolves #66
@jaylinski
Copy link
Owner

I added a fix in #70 if you want to test it.

@regseb
Copy link
Author

regseb commented Apr 27, 2024

I tested it in Kodi 20.5 and it works: I don't have duplicate video. 🚀

@jaylinski
Copy link
Owner

Thanks for the confirmation. I'll try to release the fix soonish.

jaylinski added a commit that referenced this issue Apr 27, 2024
When a video is shared with this addon, it can be
done by calling `Playlist.Add` or `Player.Open`.
If it is done via `Playlist.Add`, the item is already
in a playlist, so we don't have to do it ourselves.
If it is done via `Player.Open`, the user probably
doesn't want to create a playlist at all.

Resolves #66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants