+} from '@shared/server-commands'
+
+async function checkVideosServer1 (server: PeerTubeServer, idHttp: string, idMagnet: string, idTorrent: string) {
+ const videoHttp = await server.videos.get({ id: idHttp })
+
+ expect(videoHttp.name).to.equal('small video - youtube')
+ // FIXME: youtube-dl seems broken
+ // expect(videoHttp.category.label).to.equal('News & Politics')
+ // expect(videoHttp.licence.label).to.equal('Attribution')
+ expect(videoHttp.language.label).to.equal('Unknown')
+ expect(videoHttp.nsfw).to.be.false
+ expect(videoHttp.description).to.equal('this is a super description')
+ expect(videoHttp.tags).to.deep.equal([ 'tag1', 'tag2' ])
+ expect(videoHttp.files).to.have.lengthOf(1)
+
+ const originallyPublishedAt = new Date(videoHttp.originallyPublishedAt)
+ expect(originallyPublishedAt.getDate()).to.equal(14)
+ expect(originallyPublishedAt.getMonth()).to.equal(0)
+ expect(originallyPublishedAt.getFullYear()).to.equal(2019)
+
+ const videoMagnet = await server.videos.get({ id: idMagnet })
+ const videoTorrent = await server.videos.get({ id: idTorrent })
+
+ for (const video of [ videoMagnet, videoTorrent ]) {
+ expect(video.category.label).to.equal('Misc')
+ expect(video.licence.label).to.equal('Unknown')
+ expect(video.language.label).to.equal('Unknown')
+ expect(video.nsfw).to.be.false
+ expect(video.description).to.equal('this is a super torrent description')
+ expect(video.tags).to.deep.equal([ 'tag_torrent1', 'tag_torrent2' ])
+ expect(video.files).to.have.lengthOf(1)
+ }
+
+ expect(videoTorrent.name).to.contain('你好 世界 720p.mp4')
+ expect(videoMagnet.name).to.contain('super peertube2 video')
+
+ const bodyCaptions = await server.captions.list({ videoId: idHttp })
+ expect(bodyCaptions.total).to.equal(2)
+}