diff --git a/controller/action/DownloadActions.class.php b/controller/action/DownloadActions.class.php index 5d62de78..d8af7704 100644 --- a/controller/action/DownloadActions.class.php +++ b/controller/action/DownloadActions.class.php @@ -4,6 +4,7 @@ class DownloadActions extends Actions { //bad, fix me! const ANDROID_STORE_URL = 'https://play.google.com/store/apps/details?id=io.lbry.browser'; + const IOS_STORE_URL = 'https://apps.apple.com/us/app/odysee/id1539444143'; public static function executeDownloadPrereleaseAsset(string $repo, string $ext) { @@ -38,9 +39,10 @@ class DownloadActions extends Actions public static function getGetTemplateParams($os) { $osChoices = OS::getAll(); - list($uri, $osTitle, $osIcon) = $osChoices[$os]; + list($uri, $osTitle, $osIcon, $title) = $osChoices[$os]; $params = [ 'preferredExt' => $os === Os::OS_LINUX ? 'AppImage' : '', + 'title' => $title, 'osTitle' => $osTitle, 'osIcon' => $osIcon, 'osScreenshotSrc' => 'https://spee.ch/b/desktop-035-og.jpeg', @@ -52,6 +54,11 @@ class DownloadActions extends Actions $params['downloadUrl'] = static::ANDROID_STORE_URL; $params['osScreenshotSrc'] = 'https://spee.ch/@lbry:3f/android-08-homepage.gif'; } + else if ($os === OS::OS_IOS) + { + $params['downloadUrl'] = static::IOS_STORE_URL; + $params['osScreenshotSrc'] = 'https://spee.ch/odyseeiosimage.png'; + } else { $asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $params['preferredExt']); @@ -135,13 +142,15 @@ class DownloadActions extends Actions if ($os && isset($osChoices[$os])) { list($uri, $osTitle, $osIcon, $oldButtonLabel, $analyticsLabel) = $osChoices[$os]; - if ($os !== OS::OS_ANDROID) { - $asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $vars['preferredExt'] ?? ''); - } else { + if ($os === OS::OS_ANDROID) { $asset = ['browser_download_url' => static::ANDROID_STORE_URL]; + } else if ($os === OS::OS_IOS) { + $asset = ['browser_download_url' => static::IOS_STORE_URL]; + } else { + $asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os, $vars['preferredExt'] ?? ''); } + $buttonLabel = __('Download for %os%', ['%os%' => $osTitle]); - $buttonLabel = __('download.for-os2', ['%os%' => OS::OS_DETAIL($os)[1]]); if (isset($vars['preferredExt']) && $vars['preferredExt']) { $buttonLabel = __('Download .%ext%', ['%ext%' => $vars['preferredExt']]); } @@ -178,12 +187,15 @@ class DownloadActions extends Actions if ($os && isset($osChoices[$os])) { list($uri, $osTitle, $osIcon, $buttonLabel, $analyticsLabel) = $osChoices[$os]; - if ($os !== OS::OS_ANDROID) { - $release = Github::getRepoRelease(GitHub::REPO_LBRY_DESKTOP, false); - $asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os); - } else { + if ($os === OS::OS_ANDROID) { $asset = ['browser_download_url' => static::ANDROID_STORE_URL, 'size' => 0]; $release = []; + } else if ($os === OS::OS_IOS) { + $asset = ['browser_download_url' => static::IOS_STORE_URL, 'size' => 0]; + $release = []; + } else { + $release = Github::getRepoRelease(GitHub::REPO_LBRY_DESKTOP, false); + $asset = Github::getRepoAsset(GitHub::REPO_LBRY_DESKTOP, $os); } $vars += [ diff --git a/data/redirect/permanent.yaml b/data/redirect/permanent.yaml index 3fd43770..fc3305df 100644 --- a/data/redirect/permanent.yaml +++ b/data/redirect/permanent.yaml @@ -51,6 +51,7 @@ /lbry-osx-latest.dmg: /get /news/get: /get /getrubin: /get +/android-alpha: /android # Mailing List /join-list: /list/subscribe diff --git a/lib/tools/OS.class.php b/lib/tools/OS.class.php index aaefd516..f1f97adb 100644 --- a/lib/tools/OS.class.php +++ b/lib/tools/OS.class.php @@ -11,71 +11,16 @@ class OS OS_OSX = 'osx', OS_WINDOWS = 'windows'; - public static function OS_DETAIL($os) - { - switch ($os) { - case 'android': - return [ - '/android', - 'Android', - 'icon-android', - false, - "Android", - " Android" - ]; - - case 'ios': - return [ - '/ios', - 'iOS', - 'icon-mobile', - false, - "iOS", - " iOS" - ]; - - case 'linux': - return [ - '/linux', - 'Linux', - 'icon-linux', - __("Download .deb"), - "Linux", - " Linux" - ]; - - case 'osx': - return [ - '/osx', - 'macOS', - 'icon-apple', - __("Download for macOS"), - "OSX", - " macOS" - ]; - - case 'windows': - return [ - '/windows', - 'Windows', - 'icon-windows', - __("Download for Windows"), - "Windows", - " Windows" - ]; - } - } - public static function getAll() { //url, English name, icon class, partial name //yes, this is probably a bad pattern return [ - OS::OS_WINDOWS => ['/windows', 'Windows', 'icon-windows', __("Download for Windows"), "Windows"], - OS::OS_OSX => ['/osx', 'macOS', 'icon-apple', __("Download for macOS"), "OSX"], - OS::OS_LINUX => ['/linux', 'Linux', 'icon-linux', __("Download .deb"), "Linux"], - OS::OS_ANDROID => ['/android', 'Android', 'icon-android', false, false], - OS::OS_IOS => ['/ios', 'iOS', 'icon-ios', false, false] + OS::OS_WINDOWS => ['/windows', 'Windows', 'icon-windows', __("Get LBRY Desktop for Windows"), "Windows"], + OS::OS_OSX => ['/osx', 'macOS', 'icon-apple', __("Get LBRY Desktop for macOS"), "OSX"], + OS::OS_LINUX => ['/linux', 'Linux', 'icon-linux', __("Get LBRY Desktop for Linux"), "Linux"], + OS::OS_ANDROID => ['/android', 'Android', 'icon-android', __('Get LBRY Android'), false], + OS::OS_IOS => ['/ios', 'iOS', 'icon-ios', __('Get Odysee for iOS'), false] ]; } diff --git a/view/template/download/_downloadButton.php b/view/template/download/_downloadButton.php index 83e6c2a4..a7c2452f 100644 --- a/view/template/download/_downloadButton.php +++ b/view/template/download/_downloadButton.php @@ -1,6 +1,36 @@ - + + Download + + Download + + Download + - - Download - - Download diff --git a/view/template/download/_meta.php b/view/template/download/_meta.php index 00f54441..ec9cd694 100644 --- a/view/template/download/_meta.php +++ b/view/template/download/_meta.php @@ -4,7 +4,7 @@
- We provide app builds as AppImage and .deb. For other Linux flavors including Arch and Flatpak support or compiling from source, see our GitHub install page. + For other Linux flavors including Arch and Flatpak support or compiling from source, see our GitHub install page. Works with with macOS version 10.12.4 (Sierra), and higher. diff --git a/view/template/download/get.php b/view/template/download/get.php index e29c162f..e428a856 100644 --- a/view/template/download/get.php +++ b/view/template/download/get.php @@ -6,7 +6,7 @@

- OS::OS_DETAIL($os)[4]]) ?> +

@@ -14,10 +14,8 @@
-
-

Securely download the LBRY app here, and see what all the fuss is about!

- + 'primary', 'preferredExt' => $preferredExt @@ -33,9 +31,9 @@

You can also download our Android app directly.

-

+
@@ -48,6 +46,14 @@ src="" /> + +
+ Screenshot of Odysee +