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

[Frontend Migration]: Update API endpoint /api/playlist/{playlist-id}/video/ add searchparam filter for hide_watched videos #732

Open
MerlinScheurer opened this issue May 19, 2024 · 3 comments
Labels
backend react migration Tracking our new React based frontend

Comments

@MerlinScheurer
Copy link
Collaborator

MerlinScheurer commented May 19, 2024

Domain

Backend

Description

Is your feature request related to a problem? Please describe.

A filter searchparam for the page /api/playlist/{playlist-id}/video/ is missing in the api.

Describe the solution you'd like

The searchparam filter hide_watched has been added to the Api endpoint /api/playlist/{playlist-id}/video/

Additional context

/api/playlist/{playlist-id}/video/ ( GET )

SearchParams:
filter: "hide_watched"
page: "0"

Possibly implemented in a module way as described in #721

@MerlinScheurer MerlinScheurer added the react migration Tracking our new React based frontend label May 19, 2024
@bbilly1
Copy link
Member

bbilly1 commented Aug 3, 2024

Implemented at /api/video/ with playlist query param. See doc string here:

class VideoApiListView(ApiBaseView):
"""resolves to /api/video/
GET: returns list of videos
params:
- playlist:str=<playlist-id>
- channel:str=<channel-id>
- watch:enum=watched|unwatched|continue
- sort:enum=published|downloaded|views|likes|duration|filesize
- order:enum=asc|desc
- type:enum=videos|streams|shorts
"""

@MerlinScheurer
Copy link
Collaborator Author

watch=continue without any videos to continue seems to cause the endpoint to respond with http 500 and "Server Error (500)"

  "error": {
    "root_cause": [
      {
        "type": "parsing_exception",
        "reason": "[_na] query malformed, must start with start_object",
        "line": 1,
        "col": 34
      }
    ],
    "type": "x_content_parse_exception",
    "reason": "[1:34] [bool] failed to parse field [must]",
    "caused_by": {
      "type": "parsing_exception",
      "reason": "[_na] query malformed, must start with start_object",
      "line": 1,
      "col": 34
    }
  },
  "status": 400
}

@MerlinScheurer
Copy link
Collaborator Author

{"error":"'filesize' not in SortEnum"}
in backend\video\src\constants.py its media_size

But in /backend/user/src/user_config.py its filesize

VALID_SORT_BY = [
        "published",
        "downloaded",
        "views",
        "likes",
        "duration",
        "filesize",
    ]
    ```
    
    Can we change one of them to have them in sync?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend react migration Tracking our new React based frontend
Projects
Status: No status
Development

No branches or pull requests

2 participants