Merge pull request #163 from ultrasonic/develop

New 2.2.2 release
This commit is contained in:
Óscar García Amor 2018-02-12 16:59:54 +01:00 committed by GitHub
commit 4d481707df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 146 additions and 73 deletions

View File

@ -38,4 +38,90 @@ jobs:
destination: reports
- store_artifacts:
path: build/reports/jacoco/jacocoFullReport/
push_translations:
docker:
- image: circleci/python:3.6
working_directory: ~/ultrasonic
steps:
- checkout
- run:
name: install transifex client
command: |
python -m venv ~/venv
. ~/venv/bin/activate
pip install transifex-client
- run:
name: configure transifex client
command: echo $'[https://www.transifex.com]\nhostname = https://www.transifex.com\nusername = api\npassword = '"${TRANSIFEX_PASSWORD}"$'\n' > ~/.transifexrc
- run:
name: push changes in translation files
command: |
. ~/venv/bin/activate
tx push -st
generate_signed_apk:
docker:
- image: circleci/android:api-27-alpha
working_directory: ~/ultrasonic
envoronment:
JAVA_TOOL_OPTIONS: "-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
steps:
- checkout
- restore_cache:
key: gradle-cache-{{ checksum "dependencies.gradle" }}
- run:
name: decrypt ultrasonic-keystore
command: openssl aes-256-cbc -K ${ULTRASONIC_KEYSTORE_KEY} -iv ${ULTRASONIC_KEYSTORE_IV} -in ultrasonic-keystore.enc -out ultrasonic-keystore -d
- run:
name: build release apk
command: ./gradlew build assembleRelease
- run:
name: sign release apk
command: |
mkdir -p /tmp/ultrasonic-release
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/ultrasonic/ultrasonic-keystore -storepass ${ULTRASONIC_KEYSTORE_STOREPASS} -keypass ${ULTRASONIC_KEYSTORE_KEYPASS} ultrasonic/build/outputs/apk/release/ultrasonic-release-unsigned.apk ultrasonic
jarsigner -verify ultrasonic/build/outputs/apk/release/ultrasonic-release-unsigned.apk
${ANDROID_HOME}/build-tools/27.0.0/zipalign -v 4 ultrasonic/build/outputs/apk/release/ultrasonic-release-unsigned.apk /tmp/ultrasonic-release/ultrasonic-${CIRCLE_TAG}.apk
- persist_to_workspace:
root: /tmp/ultrasonic-release
paths:
- ultrasonic-*.apk
publish_github_signed_apk:
docker:
- image: circleci/golang
steps:
- attach_workspace:
at: /tmp/ultrasonic-release
- run:
name: install ghr
command: go get -v github.com/tcnksm/ghr
- run:
name: publish release on github tag
command: ghr -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_TAG} /tmp/ultrasonic-release
workflows:
version: 2
build_and_push_translations:
jobs:
- build
- push_translations:
requires:
- build
filters:
branches:
only:
- develop
- master
- generate_signed_apk:
filters:
tags:
only: /^[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
- publish_github_signed_apk:
requires:
- generate_signed_apk
filters:
tags:
only: /^[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
# Release folder
ultrasonic/release/
# Built application files
*.apk
*.ap_

10
.tx/config Normal file
View File

@ -0,0 +1,10 @@
[main]
host = https://www.transifex.com
lang_map = fr_CA:fr-rCA,pt_BR:pt-rBR,pt_PT:pt,zh_CN:zh-rCN,zh_HK:zh-rHK,zh_TW:zh-rTW,da_DK:da-rDK,de_DE:de,tr_TR:tr,fr_FR:fr,es_ES:es,hu_HU:hu,sv_SE:sv-rSE,bg_BG:bg,el_GR:el,kn_IN:kn-rIN,cs_CZ:cs,sr:sr,he:iw,id:in,lt_LT:lt,km_KH:km-rKH,th_TH:th
[ultrasonic.app]
file_filter = ultrasonic/src/main/res/values-<lang>/strings.xml
source_file = ultrasonic/src/main/res/values/strings.xml
source_lang = en
type = ANDROID

View File

@ -13,7 +13,6 @@ buildscript {
classpath gradlePlugins.ktlintGradle
classpath gradlePlugins.detekt
classpath gradlePlugins.jacocoAndroid
classpath gradlePlugins.buildVersioning
}
}

View File

@ -1,4 +1,7 @@
ext.versions = [
versionCode : 63,
versionName : "2.2.2",
minSdk : 14,
targetSdk : 22,
compileSdk : 27,
@ -10,7 +13,6 @@ ext.versions = [
detekt : "1.0.0.RC6",
jacoco : "0.7.9",
jacocoAndroid : "0.1.2",
buildVersioning : "1.6.0",
androidSupport : "22.2.1",
@ -28,12 +30,11 @@ ext.versions = [
]
ext.gradlePlugins = [
androidTools : "com.android.tools.build:gradle:$versions.androidTools",
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin",
ktlintGradle : "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:$versions.ktlintGradle",
detekt : "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$versions.detekt",
jacocoAndroid : "com.dicedmelon.gradle:jacoco-android:$versions.jacocoAndroid",
buildVersioning : "org.moallemi.gradle.advanced-build-version:gradle-plugin:$versions.buildVersioning",
androidTools : "com.android.tools.build:gradle:$versions.androidTools",
kotlin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin",
ktlintGradle : "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:$versions.ktlintGradle",
detekt : "gradle.plugin.io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$versions.detekt",
jacocoAndroid : "com.dicedmelon.gradle:jacoco-android:$versions.jacocoAndroid"
]
ext.androidSupport = [

BIN
ultrasonic-keystore.enc Normal file

Binary file not shown.

View File

@ -1,30 +1,15 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'jacoco-android'
apply plugin: 'org.moallemi.advanced-build-version'
apply from: "../gradle_scripts/code_quality.gradle"
advancedVersioning {
nameOptions {
versionMajor 2
versionMinor 2
versionPatch 1
}
codeOptions {
versionCodeType org.moallemi.gradle.internal.VersionCodeType.AUTO_INCREMENT_ONE_STEP
}
outputOptions {
renameOutput true
}
}
android {
compileSdkVersion versions.compileSdk
defaultConfig {
applicationId "org.moire.ultrasonic"
versionCode advancedVersioning.versionCode
versionName advancedVersioning.versionName
versionCode versions.versionCode
versionName versions.versionName
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk

View File

@ -202,4 +202,4 @@
</receiver>
</application>
</manifest>
</manifest>

View File

@ -18,6 +18,8 @@
*/
package org.moire.ultrasonic.domain;
import android.support.annotation.NonNull;
import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -352,6 +354,7 @@ public class MusicDirectory
this.bitRate = bitRate;
}
@NonNull
public String getCoverArt()
{
return coverArt;

View File

@ -21,6 +21,7 @@ package org.moire.ultrasonic.service;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.os.PowerManager;
import android.text.TextUtils;
import android.util.Log;
import org.moire.ultrasonic.domain.MusicDirectory;
@ -457,8 +458,7 @@ public class DownloadFile
{
try
{
if (song.getCoverArt() != null)
{
if (!TextUtils.isEmpty(song.getCoverArt())) {
int size = Util.getMinDisplayMetric(context);
musicService.getCoverArt(context, song, size, true, true, null);
}

View File

@ -23,6 +23,7 @@ import android.graphics.Bitmap;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.text.TextUtils;
import android.util.Log;
import org.moire.ultrasonic.R;
@ -654,7 +655,7 @@ public class RESTMusicService implements MusicService {
Log.d(TAG, "Loading cover art for: " + entry);
final String id = entry.getCoverArt();
if (id == null || id.isEmpty()) {
if (TextUtils.isEmpty(id)) {
return null; // Can't load
}

View File

@ -22,6 +22,7 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;
import android.text.TextUtils;
import android.util.Log;
import org.moire.ultrasonic.activity.SubsonicTabActivity;
@ -74,12 +75,9 @@ public class FileUtil
}
fileName.append(fileSystemSafe(song.getTitle())).append('.');
if (song.getTranscodedSuffix() != null)
{
if (!TextUtils.isEmpty(song.getTranscodedSuffix())) {
fileName.append(song.getTranscodedSuffix());
}
else
{
} else {
fileName.append(song.getSuffix());
}
@ -324,13 +322,10 @@ public class FileUtil
File dir;
if (entry.getPath() != null)
{
if (!TextUtils.isEmpty(entry.getPath())) {
File f = new File(fileSystemSafeDir(entry.getPath()));
dir = new File(String.format("%s/%s", getMusicDirectory(context).getPath(), entry.isDirectory() ? f.getPath() : f.getParent()));
}
else
{
} else {
String artist = fileSystemSafe(entry.getArtist());
String album = fileSystemSafe(entry.getAlbum());

View File

@ -25,6 +25,7 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
@ -179,8 +180,7 @@ public class ImageLoader implements Runnable
String coverArt = entry.getCoverArt();
if (coverArt == null)
{
if (TextUtils.isEmpty(coverArt)) {
setUnknownImage(view, large);
return;
}
@ -230,8 +230,7 @@ public class ImageLoader implements Runnable
String coverArt = entry.getCoverArt();
if (coverArt == null)
{
if (TextUtils.isEmpty(coverArt)) {
return null;
}

View File

@ -21,6 +21,7 @@ package org.moire.ultrasonic.view;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@ -168,7 +169,10 @@ public class SongView extends UpdateView implements Checkable
String suffix = song.getSuffix();
String transcodedSuffix = song.getTranscodedSuffix();
fileFormat = transcodedSuffix == null || transcodedSuffix.equals(suffix) || (song.isVideo() && Util.getVideoPlayerType(this.context) != VideoPlayerType.FLASH) ? suffix : String.format("%s > %s", suffix, transcodedSuffix);
fileFormat = TextUtils.isEmpty(transcodedSuffix) ||
transcodedSuffix.equals(suffix) ||
(song.isVideo() && Util.getVideoPlayerType(this.context) != VideoPlayerType.FLASH) ?
suffix : String.format("%s > %s", suffix, transcodedSuffix);
String artistName = song.getArtist();

View File

@ -14,6 +14,9 @@
<string name="button_bar.chat">Chat</string>
<string name="button_bar.home">Inicio de UltraSonic</string>
<string name="button_bar.now_playing">Reproduciendo ahora</string>
<string name="podcasts.label">Podcast</string>
<string name="podcasts_channels.empty">No hay canales de Podcasts registrados</string>
<string name="button_bar.podcasts">Podcast</string>
<string name="button_bar.playlists">Listas de reproducción</string>
<string name="button_bar.search">Buscar</string>
<string name="chat.send_a_message">Enviar un mensaje</string>
@ -393,9 +396,7 @@
<string name="settings.image_loader_concurrency_12">12</string>
<string name="albumArt">Caratula del Álbum</string>
<string name="common_multiple_years">Múltiples años</string>
<plurals name="select_album_n_songs">
<item quantity="zero">Ninguna canción</item>
<item quantity="one">1 canción</item>
<item quantity="other">%d canciones</item>
</plurals>
@ -423,9 +424,6 @@
<item quantity="one">Queda un día de periodo de prueba</item>
<item quantity="other">Quedan %d días de periodo de prueba</item>
</plurals>
<string name="button_bar.podcasts">Podcast</string>
<string name="podcasts.label">Podcast</string>
<string name="podcasts_channels.empty">No hay canales de Podcasts registrados</string>
<!-- Subsonic api errors -->
<string name="api.subsonic.generic">Error genérico de api: %1$s</string>
@ -439,4 +437,4 @@
<string name="api.subsonic.upgrade_client">Versiones incompatibles. Por favor actualiza la aplicación de Android UltraSonic.</string>
<string name="api.subsonic.upgrade_server">Versiones incompatibles. Por favor actualiza el servidor de Subsonic.</string>
</resources>
</resources>

View File

@ -14,6 +14,9 @@
<string name="button_bar.chat">Salon de discussion</string>
<string name="button_bar.home">Accueil Ultrasonic</string>
<string name="button_bar.now_playing">Lecture en cours</string>
<string name="podcasts.label">Podcast</string>
<string name="podcasts_channels.empty">No podcasts channels registered</string>
<string name="button_bar.podcasts">Podcast</string>
<string name="button_bar.playlists">Playlists</string>
<string name="button_bar.search">Recherche</string>
<string name="chat.send_a_message">Envoyer un message</string>
@ -236,8 +239,8 @@
<string name="settings.network_timeout_60000">60 secondes</string>
<string name="settings.network_timeout_75000">75 secondes</string>
<string name="settings.network_timeout_90000">90 secondes</string>
<string name="settings.network_title">Réseau</string>
<string name="settings.notifications_title">Notifications</string>
<string name="settings.network_title">Réseau</string>
<string name="settings.other_title">Autres paramètres</string>
<string name="settings.playback_control_title">Paramètres de contrôle de lecture</string>
<string name="settings.preload">Titres à pré-charger</string>
@ -393,9 +396,7 @@
<string name="settings.image_loader_concurrency_12">12</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Multiple Years</string>
<plurals name="select_album_n_songs">
<item quantity="zero">Aucun titre</item>
<item quantity="one">Un titre</item>
<item quantity="other">%d titres</item>
</plurals>
@ -423,9 +424,6 @@
<item quantity="one">Un jour restant à la période d\'essai</item>
<item quantity="other">%d jours restant à la période d\'essai</item>
</plurals>
<string name="button_bar.podcasts">Podcast</string>
<string name="podcasts.label">Podcast</string>
<string name="podcasts_channels.empty">No podcasts channels registered</string>
<!-- Subsonic api errors -->
<string name="api.subsonic.generic">Erreur api générique: %1$s</string>
@ -439,4 +437,4 @@
<string name="api.subsonic.upgrade_client">Versions incompatible. Veuillez mette à jour l\'application Android UltraSonic.</string>
<string name="api.subsonic.upgrade_server">Versions incompatible. Veuillez mette à jour le serveur Subsonic.</string>
</resources>
</resources>

View File

@ -14,6 +14,9 @@
<string name="button_bar.chat">Csevegés (Chat)</string>
<string name="button_bar.home">UltraSonic főoldal</string>
<string name="button_bar.now_playing">Lejátszó</string>
<string name="podcasts.label">Podcast</string>
<string name="podcasts_channels.empty">No podcasts channels registered</string>
<string name="button_bar.podcasts">Podcast</string>
<string name="button_bar.playlists">Lejátszási listák</string>
<string name="button_bar.search">Keresés</string>
<string name="chat.send_a_message">Üzenet küldése</string>
@ -393,9 +396,7 @@
<string name="settings.image_loader_concurrency_12">12</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Multiple Years</string>
<plurals name="select_album_n_songs">
<item quantity="zero">Nincsenek dalok</item>
<item quantity="one">1 dal</item>
<item quantity="other">%d dal</item>
</plurals>
@ -423,9 +424,6 @@
<item quantity="one">1 nap van hátra a próba időszakból.</item>
<item quantity="other">%d nap van hátra a próba időszakból.</item>
</plurals>
<string name="button_bar.podcasts">Podcast</string>
<string name="podcasts.label">Podcast</string>
<string name="podcasts_channels.empty">No podcasts channels registered</string>
<!-- Subsonic api errors -->
<string name="api.subsonic.generic">Általános api hiba: %1$s</string>
@ -439,4 +437,4 @@
<string name="api.subsonic.upgrade_client">Nem kompatibilis verzió. Kérjük, frissítse az UltraSonic Android alkalmazást!</string>
<string name="api.subsonic.upgrade_server">Nem kompatibilis verzió. Kérjük, frissítse a Subsonic kiszolgálót!</string>
</resources>
</resources>

View File

@ -396,9 +396,7 @@
<string name="settings.image_loader_concurrency_12">12</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Múltiplos Anos</string>
<plurals name="select_album_n_songs">
<item quantity="zero">Nenhuma música</item>
<item quantity="one">1 música</item>
<item quantity="other">%d músicas</item>
</plurals>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<resources>
<string name="background_task.loading">Carregando&#8230;</string>
<string name="background_task.network_error">Ocorreu um erro de rede. Verifique o endereço do servidor ou tente mais tarde.</string>
@ -396,9 +396,7 @@
<string name="settings.image_loader_concurrency_12">12</string>
<string name="albumArt">albumArt</string>
<string name="common_multiple_years">Múltiplos Anos</string>
<plurals name="select_album_n_songs" tools:ignore="UnusedQuantity">
<item quantity="zero">Nenhuma música</item>
<plurals name="select_album_n_songs">
<item quantity="one">%d música</item>
<item quantity="other">%d músicas</item>
</plurals>

View File

@ -401,7 +401,6 @@
<string name="settings.server_address_unset" translatable="false">http://example.com</string>
<plurals name="select_album_n_songs">
<item quantity="zero">No songs</item>
<item quantity="one">1 song</item>
<item quantity="other">%d songs</item>
</plurals>
@ -442,4 +441,4 @@
<string name="api.subsonic.upgrade_client">Incompatible versions. Please upgrade UltraSonic Android app.</string>
<string name="api.subsonic.upgrade_server">Incompatible versions. Please upgrade Subsonic server.</string>
</resources>
</resources>

View File

@ -1,2 +0,0 @@
#Tue Jan 23 22:14:32 CET 2018
AI_VERSION_CODE=62