Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c713416faf | ||
|
|
401dd2864b |
No files matched your search
@@ -12,7 +12,7 @@ class DownloadActions extends Actions
|
||||
|
||||
public static function executeDownloadReleaseAsset(string $repo, string $ext, bool $allowPrerelease = false)
|
||||
{
|
||||
return Controller::redirect(GitHub::getRepoReleaseUrl($repo, $ext, $allowPrerelease) ?: '/get', 302);
|
||||
return Controller::redirect(GitHub::getRepoReleaseUrl($repo, OS::getOsForExtension($ext), $allowPrerelease) ?: '/get', 302);
|
||||
}
|
||||
|
||||
public static function executeDownloadSnapshot(string $type)
|
||||
@@ -40,7 +40,6 @@ class DownloadActions extends Actions
|
||||
$osChoices = OS::getAll();
|
||||
list($uri, $osTitle, $osIcon) = $osChoices[$os];
|
||||
$params = [
|
||||
'preferredExt' => $os === Os::OS_LINUX ? 'AppImage' : '',
|
||||
'osTitle' => $osTitle,
|
||||
'osIcon' => $osIcon,
|
||||
'osScreenshotSrc' => 'https://spee.ch/b/desktop-035-og.jpeg',
|
||||
@@ -54,7 +53,7 @@ class DownloadActions extends Actions
|
||||
}
|
||||
else
|
||||
{
|
||||
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $params['preferredExt']);
|
||||
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os);
|
||||
$params['downloadUrl'] = $asset ? $asset['browser_download_url'] : null;
|
||||
}
|
||||
|
||||
@@ -133,36 +132,21 @@ class DownloadActions extends Actions
|
||||
$os = static::guessOS();
|
||||
|
||||
if ($os && isset($osChoices[$os])) {
|
||||
list($uri, $osTitle, $osIcon, $oldButtonLabel, $analyticsLabel) = $osChoices[$os];
|
||||
list($uri, $osTitle, $osIcon, $buttonLabel, $analyticsLabel) = $osChoices[$os];
|
||||
|
||||
if ($os !== OS::OS_ANDROID) {
|
||||
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $vars['preferredExt'] ?? '');
|
||||
$asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os);
|
||||
} else {
|
||||
$asset = ['browser_download_url' => static::ANDROID_STORE_URL];
|
||||
}
|
||||
|
||||
$buttonLabel = __('download.for-os2', ['%os%' => OS::OS_DETAIL($os)[1]]);
|
||||
if (isset($vars['preferredExt']) && $vars['preferredExt']) {
|
||||
$buttonLabel = __('Download .%ext%', ['%ext%' => $vars['preferredExt']]);
|
||||
}
|
||||
|
||||
$vars += [
|
||||
'analyticsLabel' => $analyticsLabel,
|
||||
'buttonLabel' => $buttonLabel,
|
||||
'isDownload' => true,
|
||||
'downloadUrl' => $asset ? $asset['browser_download_url'] : null,
|
||||
'os' => $os,
|
||||
'skipRender' => isset($vars['preferredExt']) && $vars['preferredExt'] &&
|
||||
substr_compare($asset['browser_download_url'], $vars['preferredExt'], -strlen($vars['preferredExt'])) !== 0,
|
||||
'isAuto' => Request::getParam('auto'),
|
||||
];
|
||||
|
||||
|
||||
|
||||
if ($os === OS::OS_LINUX && !isset($vars['preferredExt'])) {
|
||||
$vars['isDownload'] = false;
|
||||
$vars['downloadUrl'] = '/linux';
|
||||
}
|
||||
}
|
||||
|
||||
return $vars;
|
||||
|
||||
@@ -73,13 +73,11 @@
|
||||
/get/lbrynet.macos.zip: /releases/lbry.pkg
|
||||
/get/lbrynet.osx.zip: /releases/lbry.pkg
|
||||
/get/lbry.deb: /releases/lbry-desktop.deb
|
||||
/get/lbry.AppImage: /releases/lbry-desktop.AppImage
|
||||
/get/lbry.dmg: /releases/lbry-desktop.dmg
|
||||
/get/lbry.pkg: /releases/lbry-desktop.dmg
|
||||
/get/lbry.exe: /releases/lbry-desktop.exe
|
||||
/get/lbry.msi: /releases/lbry-desktop.exe
|
||||
/get/lbry.pre.deb: /releases/pre/lbry-desktop.deb
|
||||
/get/lbry.pre.AppImage: /releases/pre/lbry-desktop.AppImage
|
||||
/get/lbry.pre.dmg: /releases/pre/lbry-desktop.dmg
|
||||
/get/lbry.pre.pkg: /releases/pre/lbry-desktop.dmg
|
||||
/get/lbry.pre.exe: /releases/pre/lbry-desktop.exe
|
||||
|
||||
Vendored
+7
-18
@@ -10,7 +10,7 @@ class Github
|
||||
switch ($os) {
|
||||
case OS::OS_LINUX:
|
||||
return
|
||||
in_array($ext, ['deb', 'AppImage']) ||
|
||||
in_array($ext, ['deb']) ||
|
||||
in_array($asset['content_type'], ['application/x-debian-package', 'application/x-deb']) ||
|
||||
stripos($asset['name'], 'linux') !== false;
|
||||
case OS::OS_OSX:
|
||||
@@ -30,7 +30,7 @@ class Github
|
||||
}
|
||||
}
|
||||
|
||||
protected static function findReleaseAsset(array $release, string $os, string $preferredExt = '')
|
||||
protected static function findReleaseAssetForOs(array $release, string $os)
|
||||
{
|
||||
if (!in_array($os, array_keys(OS::getAll()))) {
|
||||
throw new DomainException('Unknown OS');
|
||||
@@ -40,21 +40,11 @@ class Github
|
||||
throw new Exception('Release array missing assets - possible GitHub auth failure, auth limit, and/or inspect releases array');
|
||||
}
|
||||
|
||||
$bestAsset = null;
|
||||
foreach ($release['assets'] as $asset) {
|
||||
if (static::isAssetForOs($asset, $os)) {
|
||||
if (!$bestAsset) {
|
||||
$bestAsset = $asset;
|
||||
} else if ($os === Os::OS_LINUX) {
|
||||
$ext = pathinfo($asset['name'], PATHINFO_EXTENSION);
|
||||
if ($ext === $preferredExt || (!$preferredExt && $ext === 'AppImage')) {
|
||||
$bestAsset = $asset;
|
||||
}
|
||||
}
|
||||
return $asset;
|
||||
}
|
||||
}
|
||||
|
||||
return $bestAsset;
|
||||
}
|
||||
|
||||
public static function getRepoRelease($repo, $prerelease = false, $cache = true)
|
||||
@@ -73,17 +63,16 @@ class Github
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function getRepoAsset($repo, $os, $preferredExt = '', $prerelease = false, $cache = true)
|
||||
public static function getRepoAsset($repo, $os, $prerelease = false, $cache = true)
|
||||
{
|
||||
$release = static::getRepoRelease($repo, $prerelease, $cache);
|
||||
return $release ? static::findReleaseAsset($release, $os, $preferredExt) : null;
|
||||
return $release ? static::findReleaseAssetForOs($release, $os) : null;
|
||||
}
|
||||
|
||||
|
||||
public static function getRepoReleaseUrl($repo, $ext, bool $prerelease = false, $cache = true)
|
||||
public static function getRepoReleaseUrl($repo, $os, bool $prerelease = false, $cache = true)
|
||||
{
|
||||
$os = OS::getOsForExtension($ext);
|
||||
$asset = static::getRepoAsset($repo, $os, $ext, $prerelease, $cache);
|
||||
$asset = static::getRepoAsset($repo, $os, $prerelease, $cache);
|
||||
return $asset ? $asset['browser_download_url'] : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ class OS
|
||||
{
|
||||
switch ($ext) {
|
||||
case 'deb':
|
||||
case 'AppImage':
|
||||
return OS::OS_LINUX;
|
||||
|
||||
case 'dmg':
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php Response::addMetaImages($post->getImageUrls() ?: [Request::getHostAndProto() . '/img/og-faq.png?_cache=' . date('Y-m-d')]) ?>
|
||||
<?php Response::addMetaImages($post->getImageUrls()) ?>
|
||||
<?php Response::setMetaDescription(htmlspecialchars($post->getContentText(20, true))) ?>
|
||||
<?php NavActions::setNavUri('/learn') ?>
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<?php Response::addMetaImage(Request::getHostAndProto() . '/img/og-faq.png?_cache=' . date('Y-m-d')) ?>
|
||||
<?php Response::setMetaDescription(__('description.faq')) ?>
|
||||
|
||||
<main class="ancillary">
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
<?php if ($skipRender): ?>
|
||||
<?php elseif ($downloadUrl): ?>
|
||||
<?php if ($downloadUrl): ?>
|
||||
<?php if ($os !== OS::OS_ANDROID): ?>
|
||||
<?php if ($isDownload): ?>
|
||||
<a class="button button--<?php echo $buttonStyle?>"
|
||||
download
|
||||
href="<?php echo $downloadUrl ?>"
|
||||
id="get-download-btn"
|
||||
data-facebook-track="1"
|
||||
data-analytics-category="Sign Up"
|
||||
data-analytics-action="Download"
|
||||
data-analytics-label="<?php echo $analyticsLabel ?>"
|
||||
title="Download LBRY App"
|
||||
><?php echo $buttonLabel ?></a>
|
||||
<?php else: ?>
|
||||
<a class="button button--<?php echo $buttonStyle?>"
|
||||
href="<?php echo $downloadUrl ?>"
|
||||
id="get-download-btn"
|
||||
title="Download LBRY App"
|
||||
><?php echo $buttonLabel ?></a>
|
||||
<?php endif ?>
|
||||
<a class="button button--<?php echo $buttonStyle?>"
|
||||
download
|
||||
href="<?php echo $downloadUrl ?>"
|
||||
id="get-download-btn"
|
||||
data-facebook-track="1"
|
||||
data-analytics-category="Sign Up"
|
||||
data-analytics-action="Download"
|
||||
data-analytics-label="<?php echo $analyticsLabel ?>"
|
||||
title="Download our app"
|
||||
><?php echo __('download.for-os2', ['%os%' => OS::OS_DETAIL($os)[1]]) ?></a>
|
||||
<?php else: ?>
|
||||
<a
|
||||
class="button button--google-play"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<br/>
|
||||
|
||||
<?php if ($os === OS::OS_LINUX): ?>
|
||||
We provide app builds as AppImage and .deb. For other Linux flavors including Arch and Flatpak support or compiling from source, <a href="https://github.com/lbryio/lbry-desktop#install">see our GitHub install page</a>.
|
||||
Works with Ubuntu, Debian, or any distro with <code>apt</code> or <code>dpkg</code>. For other Linux flavors including Arch and Flatpak support or compiling from source, <a href="https://github.com/lbryio/lbry-desktop#install">see our GitHub install page</a>.
|
||||
<?php elseif ($os === OS::OS_OSX): ?>
|
||||
Works with with macOS version 10.12.4 (Sierra), and higher.
|
||||
<?php elseif ($sourceLink): ?>
|
||||
|
||||
@@ -19,15 +19,8 @@
|
||||
<p>Securely download the LBRY app here, and see what all the fuss is about!</p>
|
||||
<?php $metaHtml = $os !== OS::OS_ANDROID ? View::Render('download/_meta') : false ?>
|
||||
<?php echo View::Render('download/_downloadButton', [
|
||||
'buttonStyle' => 'primary',
|
||||
'preferredExt' => $preferredExt
|
||||
'buttonStyle' => 'primary'
|
||||
])?>
|
||||
<?php if ($os === OS::OS_LINUX && $preferredExt === 'AppImage'): ?>
|
||||
<?php echo View::Render('download/_downloadButton', [
|
||||
'buttonStyle' => 'primary',
|
||||
'preferredExt' => 'deb'
|
||||
])?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($os === OS::OS_ANDROID): ?>
|
||||
<p style="font-size: 0.8rem;">You can also <a href="http://lbry.com/releases/lbry-android.apk" title="Download our Android app directly">download</a> our Android app directly</p>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB |
Reference in new issue
Block a user