From 8d22d02422c80aeb98ee56a254b7444e609b89d7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julius=20H=C3=A4rtl?= <jus@bitgrid.net>
Date: Fri, 14 Aug 2020 17:21:35 +0200
Subject: [PATCH] Remove old shipped background
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
---
 .../lib/Service/BackgroundService.php         |  2 --
 apps/dashboard/src/App.vue                    | 23 +++++++++++--------
 .../src/components/BackgroundSettings.vue     |  5 ++--
 3 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/apps/dashboard/lib/Service/BackgroundService.php b/apps/dashboard/lib/Service/BackgroundService.php
index e8676a76e89..a651d11618f 100644
--- a/apps/dashboard/lib/Service/BackgroundService.php
+++ b/apps/dashboard/lib/Service/BackgroundService.php
@@ -37,8 +37,6 @@ use OCP\IConfig;
 class BackgroundService {
 
 	const SHIPPED_BACKGROUNDS = [
-		'flickr-148302424@N05-36591009215.jpg',
-		'flickr-paszczak000-8715851521.jpg',
 		'anatoly-mikhaltsov-butterfly-wing-scale.jpg',
 		'bernie-cetonia-aurata-take-off-composition.jpg',
 		'dejan-krsmanovic-ribbed-red-metal.jpg',
diff --git a/apps/dashboard/src/App.vue b/apps/dashboard/src/App.vue
index 33f820ecd7a..c4a41f5dac4 100644
--- a/apps/dashboard/src/App.vue
+++ b/apps/dashboard/src/App.vue
@@ -80,6 +80,19 @@ const background = loadState('dashboard', 'background')
 
 const prefixWithBaseUrl = (url) => generateFilePath('dashboard', '', 'img/') + url
 
+// FIXME: move out duplicate
+const getBackgroundUrl = (background, time = 0) => {
+	if (background === 'default') {
+		if (window.OCA.Accessibility.theme === 'dark') {
+			return prefixWithBaseUrl('eduardo-neves-pedra-azul.jpg')
+		}
+		return prefixWithBaseUrl('kamil-porembinski-clouds.jpg')
+	} else if (background === 'custom') {
+		return generateUrl('/apps/dashboard/background') + '?v=' + time
+	}
+	return prefixWithBaseUrl(background)
+}
+
 export default {
 	name: 'App',
 	components: {
@@ -111,15 +124,7 @@ export default {
 	},
 	computed: {
 		backgroundImage() {
-			if (this.background === 'default') {
-				if (window.OCA.Accessibility.theme === 'dark') {
-					return !isMobile ? prefixWithBaseUrl('flickr-148302424@N05-36591009215.jpg?v=1') : prefixWithBaseUrl('flickr-148302424@N05-36591009215-mobile.jpg?v=1')
-				}
-				return !isMobile ? prefixWithBaseUrl('flickr-paszczak000-8715851521.jpg?v=1') : prefixWithBaseUrl('flickr-paszczak000-8715851521-mobile.jpg?v=1')
-			} else if (this.background === 'custom') {
-				return generateUrl('/apps/dashboard/background') + '?v=' + this.backgroundTime
-			}
-			return prefixWithBaseUrl(this.background)
+			return getBackgroundUrl(this.background, this.backgroundTime)
 		},
 		tooltip() {
 			if (!this.firstRun) {
diff --git a/apps/dashboard/src/components/BackgroundSettings.vue b/apps/dashboard/src/components/BackgroundSettings.vue
index ad7898f8abe..b704d4b0724 100644
--- a/apps/dashboard/src/components/BackgroundSettings.vue
+++ b/apps/dashboard/src/components/BackgroundSettings.vue
@@ -48,7 +48,6 @@
 import axios from '@nextcloud/axios'
 import { generateUrl, generateFilePath } from '@nextcloud/router'
 import { loadState } from '@nextcloud/initial-state'
-import isMobile from '../mixins/isMobile'
 
 const prefixWithBaseUrl = (url) => generateFilePath('dashboard', '', 'img/') + url
 const shippedBackgroundList = loadState('dashboard', 'shippedBackgrounds')
@@ -56,9 +55,9 @@ const shippedBackgroundList = loadState('dashboard', 'shippedBackgrounds')
 const getBackgroundUrl = (background, time = 0) => {
 	if (background === 'default') {
 		if (window.OCA.Accessibility.theme === 'dark') {
-			return !isMobile ? prefixWithBaseUrl('flickr-148302424@N05-36591009215.jpg?v=1') : prefixWithBaseUrl('flickr-148302424@N05-36591009215-mobile.jpg?v=1')
+			return prefixWithBaseUrl('eduardo-neves-pedra-azul.jpg')
 		}
-		return !isMobile ? prefixWithBaseUrl('flickr-paszczak000-8715851521.jpg?v=1') : prefixWithBaseUrl('flickr-paszczak000-8715851521-mobile.jpg?v=1')
+		return prefixWithBaseUrl('kamil-porembinski-clouds.jpg')
 	} else if (background === 'custom') {
 		return generateUrl('/apps/dashboard/background') + '?v=' + time
 	}
-- 
GitLab