Coder Social home page Coder Social logo

Playlists support about peertube HOT 12 CLOSED

chocobozzz avatar chocobozzz commented on May 22, 2024 9
Playlists support

from peertube.

Comments (12)

Chocobozzz avatar Chocobozzz commented on May 22, 2024 3

Now we use a relational DBMS, the database scheme is changed.

My proposal:

playlistTable:
  {
    name: String,
    description: String,
    visibility: {
      type: String,
      enum: ['PUBLIC', 'PRIVATE']
    },
    createdAt: {
      type: Date,
      default: Date.now
    },
    updatedAt: {
      type: Date,
      default: Date.now
    },
    actorId -> references the actor that owns the playlist
  }

playlistVideoTable:
  {
    // Position of the video in the playlist
    position: {
      type: Number,
      default: 0
    },
    videoId -> references a video
    playlistId -> references a playlist
  }

from peertube.

Chocobozzz avatar Chocobozzz commented on May 22, 2024 3

I updated my comment to replace userId by actorId. An actor is a user or a channel.

from peertube.

Chocobozzz avatar Chocobozzz commented on May 22, 2024 3

Implemented in #1708

from peertube.

Chocobozzz avatar Chocobozzz commented on May 22, 2024 1

@6543 https://github.com/Chocobozzz/PeerTube/tree/feature/playlists

from peertube.

6543 avatar 6543 commented on May 22, 2024 1

@rzr Pre-Release v1.3.0-rc.1

from peertube.

Chocobozzz avatar Chocobozzz commented on May 22, 2024

For the DB model, I would add a playlist visibility: public/private.

I like the reordering API of Spotify: https://developer.spotify.com/web-api/reorder-playlists-tracks/

My opinion:

  • A playlist belongs to one user so I would prefix each route with /users/userId/.
  • playlist -> playlists to keep coherency
  • Add a video to the playlist throught the POST method and body parameters
  • Suppress a video from the playlist throught the DELETE method and body parameters
  • Rename a playlist is part of the modify playlist route

API route

  1. get /accounts/:accountId/playlists/ → get account playlists
  2. get /video-channels/:videoChannelId/playlists/ → get video channel playlists (to organize videos inside the channel)
  3. get /playlists/:id → get playlist information (+ number of videos)
  4. delete /playlists/:id → suppress a playlist
  5. get /playlists/:id/videos → get videos of the playlist
  6. post /playlists/:id/videos → add video(s) to the playlist
  7. put /playlists/:id/videos → reorder playlist
  8. delete /playlists/:id/videos/:id → delete video from the playlist
  9. put /playlists/:id → change playlist informations (name, visibility?)

Account playlists: just playlists that could be accessed and shared (if public)
Video channel playlists: playlists to organize videos inside a channel

Database schema

#14 (comment)

from peertube.

christophehenry avatar christophehenry commented on May 22, 2024

I would use PATCH to reorder the playlists and change informations as it is it's definition:

The PATCH method applies partial modifications to a resource.

from peertube.

DimitriGilbert avatar DimitriGilbert commented on May 22, 2024

I was wondering about channel's playlist (or even playlists for videos like what is hacked here https://youtu.be/5NJSCRPeNpU?t=11m0s the annotation link bottom rigth of the video)
For this reason I suggest to replace userId by something like ownerId and ownerType. It would make the playlist system very versatile at a very reasonnable cost (the GUI for it could come later but everything would be in place for it to work in the future)

from peertube.

DimitriGilbert avatar DimitriGilbert commented on May 22, 2024

works for me :)

from peertube.

6543 avatar 6543 commented on May 22, 2024

Any progress at the moment?

from peertube.

6543 avatar 6543 commented on May 22, 2024

Tanks for the great work!

from peertube.

rzr avatar rzr commented on May 22, 2024

is this feature released in any version ? Apparently not in current version:

https://github.com/Chocobozzz/PeerTube/releases/tag/v1.2.1

from peertube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.