hasgeek / hasgeek.tv

Hasgeek TV
http://hasgeek.tv
16 stars 6 forks source link

Add a recorded-date to video model #42

Open kracekumar opened 11 years ago

kracekumar commented 11 years ago

By adding a recorded date to video model it becomes easier to sort video to render the video list view similar to schedule view.

This one requires alembic script as part of patch.

jace commented 11 years ago

Good idea, but how do you handle all these scenarios:

  1. Only recording date is known
  2. Recording date, time and timezone are known (assuming that if datetime is known, location is known too)
  3. Neither date nor time is known

Problems:

  1. If you store as a datetime, you can't keep time null, so the video is marked as recorded at midnight.
  2. You can't assume midnight == no time because a video may actually be recorded at midnight (eg, hacknights)
  3. Dates don't have timezones. Only datetimes do.
  4. If you store date and time separately, thereby allowing time to be null, you have to apply timezone conversion only when both date and time are present.
  5. It doesn't make sense to have a time but no date.

Keeping separate date and time makes the most sense, but it'll mean additional logic for displaying the date+time of a video.

Finally, we need to store timezone somewhere -- either in the video or in the master playlist (the playlist the video was originally added to) or in the channel. For videos, it makes sense to display time localized to the timezone it was recorded in, not the local timezone of the viewer.

Youtube stores all metadata on a per-video basis. This includes everything from location to recording time. I initially avoided putting all the data in a video, putting it in the playlist instead (eg: recorded date) because it's repeated information. If an event was in one room, all the videos will have the same date and location, so it makes sense to set that once on the playlist itself.

We have to think about whether this still makes sense or if we should move all metadata to the video level.

kracekumar commented 11 years ago

Seems more complicated than I thought, let keep this open.