stremio-addon/addon.js
function validate(args) {
    var meta = args.query;
    if (! (args.query || args.infoHash)) return { code: 0, message: "query/infoHash required" };
    if (meta && !meta.imdb_id) return { code: 1, message: "imdb_id required" };
    if (meta && (meta.type == "series" && !(meta.hasOwnProperty("episode") && meta.hasOwnProperty("season"))))
        return { code: 2, message: "season and episode required for series type" };
    return false;
}
function validate(args) {
    var meta = args.query;
    if (! (args.query || args.infoHash)) return { code: 0, message: "query/infoHash required" };
    if (meta && !meta.imdb_id) return { code: 1, message: "imdb_id required" };
    if (meta && (meta.type == "series" && !(meta.hasOwnProperty("episode") && meta.hasOwnProperty("season"))))
        return { code: 2, message: "season and episode required for series type" };
    return false;
}
function validate ( args ) { var meta = args . query ; if ( ! ( args . query || args . infoHash ) ) return { code : 0 , message : "query/infoHash required" } ; if ( meta && ! meta . imdb_id ) return { code : 1 , message : "imdb_id required" } ; if ( meta && ( meta . type == "series" && ! ( meta . hasOwnProperty ( "episode" ) && meta . hasOwnProperty ( "season" ) ) ) ) return { code : 2 , message : "season and episode required for series type" } ; return false ; }
Basic validation of args
Basic validation of args