Development #287
2 changed files with 5 additions and 2 deletions
|
@ -6,7 +6,7 @@ function handleLbrynetResponse ({ data }, resolve, reject) {
|
||||||
if (data.result) {
|
if (data.result) {
|
||||||
// check for an error
|
// check for an error
|
||||||
if (data.result.error) {
|
if (data.result.error) {
|
||||||
logger.warn('Lbrynet api error:', data.result.error);
|
logger.debug('Lbrynet api error:', data.result.error);
|
||||||
reject(data.result.error);
|
reject(data.result.error);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
|
@ -152,12 +152,15 @@ function determineResponseType (uri, headers) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
responseType = SHOW;
|
responseType = SHOW;
|
||||||
|
if (!headers['accept'] || !headers['accept'].split(',').includes('text/html')) {
|
||||||
|
responseType = SERVE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return responseType;
|
return responseType;
|
||||||
}
|
}
|
||||||
|
|
||||||
function determineName (uri) {
|
function determineName (uri) {
|
||||||
/* patch because twitter player preview adds '>' before file extension. Note: put this inside determineName()? */
|
/* patch because twitter player preview adds '>' before file extension. */
|
||||||
if (uri.indexOf('>') !== -1) {
|
if (uri.indexOf('>') !== -1) {
|
||||||
return uri.substring(0, uri.indexOf('>'));
|
return uri.substring(0, uri.indexOf('>'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue