wyozi / gmod-medialib

Media playback library for Garry's Mod.
MIT License
42 stars 16 forks source link

Create a standard for querying meta #4

Open wyozi opened 9 years ago

wyozi commented 9 years ago
-- 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 commented 9 years ago

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 commented 9 years ago

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

This should change Service#query to following

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

where dataTypes is a table of data types to query.

wyozi commented 9 years ago

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)?