Here you can find the databse structure.
In the editor you can see the timeline of the selectedchannel. This timeline containes clips. These clips represents the actions taken in the player.
We use the unix timestamp epoch time (=1970-01-01 01:00:00.0000) for referrence.
Information for the channel:
Description: The description of the channel.
Channel Mode: You have 2 types of modes, live and movie.
Movie mode
The timeline starts at the epoch time 1970-01-01 01:00:00.0000 = 00:00:00.0000
Live mode
If the channel is in live mode the
Clip element contains:
Library
Classes: clip, status-library
data-data: (Json)
{
"title":"Ed Sheeran - Photograph (Official Music Video)",
"description":"Download on iTunes: http://smarturl.it/x-itunesdlx\\nListen on Spotify: http://smarturl.it/stream.photograph\\nDirected by Emil Nava\\n\\nSubscribe to Ed\\x27s channel: http://bit.ly/SubscribeToEdSheeran\\n\\nFollow Ed on...\\nFacebook: http://www.facebook.com/EdSheeranMusic\\nTwitter: http://twitter.com/edsheeran\\nInstagram: http://instagram.com/teddysphotos\\nOfficial Website: http://edsheeran.com\\n\\n** The best artists, the best albums, the best price **\\nGet the FREE app now \\x26 be the first to discover TOP MUSIC DEALS\\nhttp://Smarturl.it/top-music-deal",
"publishedAt":1431218411000,
"thumbnail":"https://i.ytimg.com/vi/nSDgHBxUbVQ/hqdefault.jpg?custom=true&w=320&h=180&stc=true&jpg444=true&jpgq=90&sp=68&sigh=3AX5W-VoEr8Gzu0FMPDT5pV30ZA",
"source":{
"id":"nSDgHBxUbVQ"
"name":"Youtube",
"url":"https://youtube.com/",
"sourceUrl":"https://www.youtube.com/watch?v=nSDgHBxUbVQ",
"library":"youtube"
},
"duration":275000,
// Added by interface
"in":0,
"out":275000,
"start":0,
"end":275000,
// Last time when was/os playing as clip
"currentTime":0,
"publishedAtString":"10-5-2015 02:40:11",
"durationString":"00:04:35.000",
}
Timeline
Classes: clip, status-timeline
data-start: (int) 73390
data-end: (int) 133118
data-data: (Json)
{
"_id" : ObjectId("5972bf2e74790b33ba2e8a04"),
// Content
"content": {
"_id" : ObjectId("5972bf2e74790b33ba2e8a04"),
"title" : "Eminem - Mockingbird",
"description" : "Music video by Eminem performing Mockingbird. YouTube view counts pre-VEVO: 14,297,644. (C) 2004 Aftermath Entertainment/Interscope Records",
"publishedAt" : ISODate("2017-07-25T01:51:49.060+0000"),
"thumbnail" : "https://i.ytimg.com/vi/S9bCLPwzSC0/hqdefault.jpg?custom=true&w=320&h=180&stc=true&jpg444=true&jpgq=90&sp=68&sigh=3AX5W-VoEr8Gzu0FMPDT5pV30ZA",
"source" : {
"id" : "S9bCLPwzSC0",
"name" : "Youtube",
"url" : "https://youtube.com/",
"sourceUrl" : "https://www.youtube.com/watch?v=S9bCLPwzSC0",
"library" : "youtube"
},
"duration" : NumberInt(259000),
},
// Editeble by user
"title" : "Eminem - Mockingbird",
"description" : "Music video by Eminem performing Mockingbird. YouTube view counts pre-VEVO: 14,297,644. (C) 2004 Aftermath Entertainment/Interscope Records",
"thumbnail" : "https://i.ytimg.com/vi/S9bCLPwzSC0/hqdefault.jpg?custom=true&w=320&h=180&stc=true&jpg444=true&jpgq=90&sp=68&sigh=3AX5W-VoEr8Gzu0FMPDT5pV30ZA",
"duration" : NumberInt(259000),
"in" : NumberInt(0),
"out" : NumberInt(122519),
"start" : NumberInt(478125),
"end" : NumberInt(600644),
// Just is there.
"publishedAt" : ISODate("2017-07-25T01:51:49.060+0000"),
}
Here are all the collections we use in our database.
The user collections stores all the user information
Example
{
"_id" : ObjectId("5772025a4c7959b07dda4fe2"),
"username" : "",
"password" : {
"salt" : "",
"password" : ""
},
"email" : "",
"picture" : "",
"ip" : "",
"information" : [
"firsntame" : "",
"surename" : "",
"lastname" : "",
],
"ban" : ISODate("1970-01-01T00:00:00.000+0000"),
"ban_reason" : "",
"active" : true,
"activated_on" : ISODate("2016-06-28T04:52:17.074+0000"),
"last_login" : {
"date" : ISODate("2017-07-20T21:19:13.129+0000"),
"ip" : "000.000.000.000"
},
"creation_date" : ISODate("2016-06-28T04:51:38.255+0000"),
}
Explaination per field
Field | Explaination |
---|---|
_id |
The unique id from the clip for xtv |
username |
The username |
password |
password |
Main e-mail adres, used for forgotten password. |
|
picture | The user's profile picture. |
ip | The ip adres where the user registered from |
information.firstname | Users first name (optional) |
information.surename | Users sure name (optional) |
information.lastname | Users last name (optional) |
ban | banned (bool) |
ban_reason | The reason for the ban |
active | User is active when is true, (activation mail) |
activated_on | Date when the user has activated the account |
last_login.date | Last login date |
last_login.ip | Last login ip |
creation_date | The date the channel is created. |
date_deleted |
If the date is higher then 1970-01-01 01:00.0000 the clip is deleted. |
The channel collections stores all the channel information
Example
{
"_id" : ObjectId("5775b2064c79591c77da4fe1"),
"_slug" : "Music",
"name" : "Music",
"nameCheck" : "music",
"mode" : "movie", // movie or live
"description" : "The XTV music channel",
"logo" : null,
"background" : null,
"stream" : [
"numUsers" : 0,
],
"users" : [
{
"_id" : ObjectId("5772025a4c7959b07dda4fe2"),
"username" : "Username",
"profile" : {
"picture" : "/images/ava.php?txt=U"
},
"role" : "owner"
}
],
"creation_date" : ISODate("2016-06-30T23:57:58.855+0000"),
}
Explaination per field
Field | Explaination |
---|---|
_id |
The unique id from the clip for xtv |
slug |
The slug for the channel |
name |
The name of the channel |
nameCheck |
Because searcinh for a string case insensetive is to expensive we use this field to check if a channel name is already in use. |
mode |
The current mode the channel is in, movie or live. |
description |
The description of the channel |
logo |
The logo of the channel, this is a smal image. |
thumbnail |
The thumbnail for the channel, in live mode we wil use the current clips thumbnail for the channels thumbnail. |
background |
a background image for the page of the channel, this background is used on the website, app and other applications recarding to XTV |
stream.numUsers |
The amount of users curently whatching this channel. (This is live) |
users |
The users that have acces to the channel |
users._id |
The users _id |
users.username |
The users username |
users.picture |
The users profile picture |
users.role |
The role of the user, currently we only have the ownder. |
creation_date |
The date the channel is created. |
date_deleted |
If the date is higher then 1970-01-01 01:00.0000 the clip is deleted. |
The channel collections stores all the channel information
Example
{
"_id" : ObjectId("5972bf2e74790b33ba2e8a04"),
"content_id" : ObjectId("5972bf2e74790b33ba2e8a04"),
"channel" : {
"_id" : ObjectId("5775b1b14c79591c77da4fe0"),
"_slug" : "Daargajedan",
"name" : "Daargajedan"
},
"title" : "Eminem - Mockingbird",
"description" : "Music video by Eminem performing Mockingbird. YouTube view counts pre-VEVO: 14,297,644. (C) 2004 Aftermath Entertainment/Interscope Records",
"publishedAt" : 1261714846000.0,
"thumbnail" : "https://i.ytimg.com/vi/S9bCLPwzSC0/hqdefault.jpg?custom=true&w=320&h=180&stc=true&jpg444=true&jpgq=90&sp=68&sigh=3AX5W-VoEr8Gzu0FMPDT5pV30ZA",
"duration" : NumberInt(259000),
"in" : NumberInt(0),
"out" : NumberInt(122519),
"start" : NumberInt(478125),
"end" : NumberInt(600644),
"date_deleted" : ISODate("2017-07-25T01:51:49.060+0000")
}
Explaination per field
Field | Explaination |
---|---|
_id | The unique id from the clip for xtv |
content_id | The unique id for the content collection |
channel._id | The unique id for the channel |
channel._slug | The slug for the channel |
channel.name | The name from the channel |
title | The title used in the player, the user can edit this. |
description | The description used in the player, the user can edit this. |
publishedAt | The publish date of the clip, the date the clip landed in the timeline. |
thumbnail | The thumbnail for this clip, this can be used to refresh the channel thumbnail. |
duration | The duration of the clip in milliseconds. |
in | The in time in milliseconds |
out | The out time in milliseconds |
start | The start time of a clip, if the channel is in movie mode we use the unixtimestamp epoch time from 1970-01-01 00:00:00.000 so if youre timeline is at 02:00.0000 youre are at 1970-01-01 00:02:00.000 |
end | Same as the start time but here ends the clip. |
date_deleted | If the date is higher then 1970-01-01 01:00.0000 the clip is deleted. |
In this collection we store all the content form other services.
It could be that different sources have a different schema.
Example
{
"_id" : ObjectId("5972bf2e74790b33ba2e8a04"),
"title" : "Eminem - Mockingbird",
"description" : "Music video by Eminem performing Mockingbird. YouTube view counts pre-VEVO: 14,297,644. (C) 2004 Aftermath Entertainment/Interscope Records",
"publishedAt" : ISODate("2017-07-25T01:51:49.060+0000"),
"thumbnail" : "https://i.ytimg.com/vi/S9bCLPwzSC0/hqdefault.jpg?custom=true&w=320&h=180&stc=true&jpg444=true&jpgq=90&sp=68&sigh=3AX5W-VoEr8Gzu0FMPDT5pV30ZA",
"duration" : NumberInt(259000),
"source" : {
"id" : "S9bCLPwzSC0",
"name" : "Youtube",
"url" : "https://youtube.com/",
"sourceUrl" : "https://www.youtube.com/watch?v=S9bCLPwzSC0",
"library" : "youtube"
},
"date_deleted" : ISODate("2017-07-25T01:51:49.060+0000")
}
Explaination per field
Field | Explaination |
---|---|
_id | The unique id for xtv |
title | The title of the content |
description |
The description |
publishedAt |
The publish date |
thumbnail |
An exernal url to a image |
duration |
The duration in milliseconds. |
source |
This contains all the info about the source |
source.id |
The unique identifier of the content |
source.name |
The name of the source like YouTube |
source.url |
The url to the source http://youtube.com |
source.sourceUrl |
The url to the content page https://www.youtube.com/watch?v=S9bCLPwzSC0 |
source.library |
Wich library in XTV |
}