From 061b5f8a6107a635ba669bdde1dbf07fae001d50 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Tue, 28 May 2013 20:44:39 -0700 Subject: cover.jpg -> albumart.jpg for better hiding in gallery --- .../github/daneren2005/dsub/updates/Updater.java | 2 +- .../daneren2005/dsub/updates/Updater373.java | 58 ---------------------- .../daneren2005/dsub/updates/Updater403.java | 58 ++++++++++++++++++++++ .../github/daneren2005/dsub/util/Constants.java | 2 +- 4 files changed, 60 insertions(+), 60 deletions(-) delete mode 100644 subsonic-android/src/github/daneren2005/dsub/updates/Updater373.java create mode 100644 subsonic-android/src/github/daneren2005/dsub/updates/Updater403.java (limited to 'subsonic-android') diff --git a/subsonic-android/src/github/daneren2005/dsub/updates/Updater.java b/subsonic-android/src/github/daneren2005/dsub/updates/Updater.java index c239fa43..60a17b67 100644 --- a/subsonic-android/src/github/daneren2005/dsub/updates/Updater.java +++ b/subsonic-android/src/github/daneren2005/dsub/updates/Updater.java @@ -43,7 +43,7 @@ public class Updater { public void checkUpdates(Context context) { this.context = context; List updaters = new ArrayList(); - updaters.add(new Updater373()); + updaters.add(new Updater403()); SharedPreferences prefs = Util.getPreferences(context); int lastVersion = prefs.getInt(Constants.LAST_VERSION, 0); diff --git a/subsonic-android/src/github/daneren2005/dsub/updates/Updater373.java b/subsonic-android/src/github/daneren2005/dsub/updates/Updater373.java deleted file mode 100644 index b56c2731..00000000 --- a/subsonic-android/src/github/daneren2005/dsub/updates/Updater373.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - This file is part of Subsonic. - - Subsonic is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Subsonic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Subsonic. If not, see . - - Copyright 2009 (C) Sindre Mehus - */ -package github.daneren2005.dsub.updates; - -import android.content.Context; -import android.util.Log; -import github.daneren2005.dsub.updates.Updater; -import github.daneren2005.dsub.util.Constants; -import github.daneren2005.dsub.util.FileUtil; -import java.io.File; - -/** - * - * @author Scott - */ -public class Updater373 extends Updater { - public Updater373() { - super(373); - TAG = Updater373.class.getSimpleName(); - } - - @Override - public void update(Context context) { - // Rename cover.jpeg to cover.jpg - Log.i(TAG, "Running Updater373: updating cover.jpeg to cover.jpg"); - File dir = FileUtil.getMusicDirectory(context); - if(dir != null) { - moveArt(dir); - } - } - - private void moveArt(File dir) { - for(File file: dir.listFiles()) { - if(file.isDirectory()) { - moveArt(file); - } else if("cover.jpeg".equals(file.getName())) { - File renamed = new File(dir, Constants.ALBUM_ART_FILE); - file.renameTo(renamed); - } - } - } -} diff --git a/subsonic-android/src/github/daneren2005/dsub/updates/Updater403.java b/subsonic-android/src/github/daneren2005/dsub/updates/Updater403.java new file mode 100644 index 00000000..17947ce5 --- /dev/null +++ b/subsonic-android/src/github/daneren2005/dsub/updates/Updater403.java @@ -0,0 +1,58 @@ +/* + This file is part of Subsonic. + + Subsonic is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Subsonic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Subsonic. If not, see . + + Copyright 2009 (C) Sindre Mehus + */ +package github.daneren2005.dsub.updates; + +import android.content.Context; +import android.util.Log; +import github.daneren2005.dsub.updates.Updater; +import github.daneren2005.dsub.util.Constants; +import github.daneren2005.dsub.util.FileUtil; +import java.io.File; + +/** + * + * @author Scott + */ +public class Updater403 extends Updater { + public Updater403() { + super(403); + TAG = Updater403.class.getSimpleName(); + } + + @Override + public void update(Context context) { + // Rename cover.jpeg to cover.jpg + Log.i(TAG, "Running Updater403: updating cover.jpg to albumart.jpg"); + File dir = FileUtil.getMusicDirectory(context); + if(dir != null) { + moveArt(dir); + } + } + + private void moveArt(File dir) { + for(File file: dir.listFiles()) { + if(file.isDirectory()) { + moveArt(file); + } else if("cover.jpg".equals(file.getName()) || "cover.jpeg".equals(file.getName())) { + File renamed = new File(dir, Constants.ALBUM_ART_FILE); + file.renameTo(renamed); + } + } + } +} diff --git a/subsonic-android/src/github/daneren2005/dsub/util/Constants.java b/subsonic-android/src/github/daneren2005/dsub/util/Constants.java index 29c9a1aa..b1fcf5e6 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/Constants.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/Constants.java @@ -118,7 +118,7 @@ public final class Constants { // URL for project donations. public static final String DONATION_URL = "http://subsonic.org/pages/android-donation.jsp"; - public static final String ALBUM_ART_FILE = "cover.jpg"; + public static final String ALBUM_ART_FILE = "albumart.jpg"; private Constants() { } -- cgit v1.2.3