gmod-medialib icon indicating copy to clipboard operation
gmod-medialib copied to clipboard

Create a standard for querying meta

Open wyozi opened this issue 9 years ago • 3 comments

-- For all
title = "x"
duration = -1 -- -1 signifies unavailability/non-finite length, but duration MUST still always exist

error = "x" -- if video can't be played for some reason eg. country restriction

-- For twitch, ustream, webradio
isStream = true
isStreamOnline = true

-- For webradio
currentSong = "song title"

wyozi avatar Mar 10 '15 20:03 wyozi

Also needs a standard for error strings.

Example: error_id:Readable error string that can describe the error better

timed_out:Video query timed out
inexistent:Video does not exist
apierror:API error (eg. didn't return JSON or 404'd)

Note: these should only be query related errors. If video can't be played because of eg. country restriction, it should be specified in 'error' field of meta instead of a query error

wyozi avatar Mar 15 '15 10:03 wyozi

Also add a way to tell query function what data should be queried for. Possible dataTypes:

  • nil (url) [this is default for all queries]
  • basic (title, duration, isStream)
  • streamInfo (isStreamOnline, currentSong for webradio)
  • id3 (runs id3 parser and mp3duration parsers, note: mp3duration should be stored in another field than duration)

This should change Service#query to following

Service#query(link [, dataTypes], callback)

where dataTypes is a table of data types to query.

wyozi avatar Mar 28 '15 00:03 wyozi

Also needs a way to force update cached mediaclip:lookupMeta.

Does this mean some keys should have a flag that means they can not update and don't need to be re-queried or vice versa (some keys should have a flag that they can update)?

wyozi avatar May 14 '15 14:05 wyozi