Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
12.94k stars 1.49k forks source link

New db parameter does not sync to following instances #4112

Closed zanhesl closed 3 years ago

zanhesl commented 3 years ago

Peertube Version: 3.1.0

Goal: I want to add aspect ratio of a video to api call /api/v1/videos/video_id

Implementation: Firstly, I created new db migration:

Снимок экрана 2021-05-20 в 12 44 33

Then I added new attribute to video model (path is at the top end of the screenshot):

Снимок экрана 2021-05-20 в 12 45 54

Same goes to video-create model

Снимок экрана 2021-05-20 в 12 50 05

And then added new param to the api:

Снимок экрана 2021-05-20 в 12 51 48 Снимок экрана 2021-05-20 в 12 52 14 Снимок экрана 2021-05-20 в 12 52 49

It works fine, however when I am trying to access video information from another following server, aspect ratio is always zero.

How can I fix this?

Thanks for your attention.

zanhesl commented 3 years ago

Maybe someone could tell me, which procedure initialises video copying from followed instance (I have redundancy enabled on both servers).

zanhesl commented 3 years ago

My fork is here: https://github.com/zanhesl/PeerTube/tree/pocketnet-updates, and the last commit somehow brakes redundancy at all

Chocobozzz commented 3 years ago

Hello,

You can create a plugin instead using filter:api.video.get.result hook: https://docs.joinpeertube.org/api-plugins