Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Commit

Permalink
Start handling downloads yourself, Odysseus!
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Cochrane committed Mar 7, 2018
1 parent 552c348 commit 3f8c750
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Traits/navigate/autodownload.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ namespace Odysseus.Traits {
if (!response_decision.is_mime_type_supported() ||
/* Show videos in Audience */
mime_type.has_prefix("video/") || mime_type == "application/ogg") {
var appinfo = AppInfo.get_default_for_type(mime_type, false);
// TODO This commented would be a nice experience, if only it
// worked well in combination with cookies.
// (I tried, and ended up with libSoup being unwilling to synchronize)
/*var appinfo = AppInfo.get_default_for_type(mime_type, false);
if (appinfo.supports_uris()) {
// Probably means it supports HTTP URIs.
var uris = new List<string>();
Expand All @@ -34,8 +37,10 @@ namespace Odysseus.Traits {
appinfo.launch_uris(uris, null);
decision.ignore();
return true;
} catch (Error e) {/* Fallback to download */}
}
} catch (Error e) {
// Fallback to download
}
}*/

// Didn't work, download it first.
decision.download();
Expand Down

0 comments on commit 3f8c750

Please sign in to comment.