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

Object-based schema #9

Closed
Owez opened this issue Aug 21, 2022 · 3 comments
Closed

Object-based schema #9

Owez opened this issue Aug 21, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@Owez
Copy link
Owner

Owez commented Aug 21, 2022

Whilst we're still in development, I want to revise the schema to use arrays and json objects to simplify parsing, and because it's more logical. This doesn't have any real downsides except for maybe being easier to identify videos when you collapse json in an editor during debugging.

The version will still be 1 because this is pre-release. Any breaking changes after yark is published to PyPI will have the schema's version increment.

Current

We currently rely on videos being like this:

"videos":
    // video
    "id": {
        // rest of video
    },
    // video
    "id": {
        // rest of video
    }
}

This isn't optimal because the ID is hard to get out and it has some edge cases and stuff that isn't nice when using jinja.

Revised

The better model for the schema would be object-based:

"videos": [
    // video
    {
        "id": "id",
        // rest of video
    },
    // video
    {
        "id": "id",
        // rest of video
    }
]

It is also just far easier to parse with python so it'll make conversion efforts and the reuse of video.id down. This revised format will also be used for the new #10 noting feature.

@Owez Owez added the enhancement New feature or request label Aug 21, 2022
@Owez Owez self-assigned this Aug 21, 2022
@Owez Owez mentioned this issue Aug 21, 2022
@Owez
Copy link
Owner Author

Owez commented Aug 22, 2022

Because yt-dlp can support other providers than just YouTube, there should be a new "provider": "name" bit at the root of the archive file. This will always be YouTube for the time being but it'll become very useful in the future.

@Owez
Copy link
Owner Author

Owez commented Aug 26, 2022

Because yt-dlp can support other providers than just YouTube, there should be a new "provider": "name" bit at the root of the archive file. This will always be YouTube for the time being but it'll become very useful in the future.

Won't do this for now because there aren't any other providers aside from YouTube I'd like to implement at the minute. Can do this later down the road though.

@Owez Owez closed this as completed in cba9f58 Aug 26, 2022
@Owez
Copy link
Owner Author

Owez commented Jan 15, 2023

This was a bad change to make, this will be reverted in v4 of the archive format, releasing in Yark 1.3. Having videos[id] is something which is needed if we want to stretch JSON out to doing mild relations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant