Skip to content

Commit

Permalink
Merge pull request #118 from icefields/v100-56_playlists_improvements
Browse files Browse the repository at this point in the history
V100 56 playlists improvements
  • Loading branch information
icefields committed May 24, 2024
2 parents 00f1284 + 9ddea94 commit db4cc6f
Show file tree
Hide file tree
Showing 29 changed files with 301 additions and 300 deletions.
35 changes: 18 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Feature rich music client for Ampache, Subsonic, Nextcloud backends, provides al

## Contributing
Power Ampache 2 is developed using Clean Architecture on top of MVVM, following SOLID principles.<br>
***A complete contribution readme coming soon***. In the meantime, before starting any contribution, please contact me for an overview of the design patterns, code style and libraries used.
***A complete contribution readme coming soon***. In the meantime, before starting any contribution, please contact me for an overview of the design patterns, code style and libraries used.
<!-- - Fork the repository.
- Make your changes in a separate branch.
- Open a pull request. -->
Expand Down Expand Up @@ -126,21 +126,22 @@ Enjoy a clean, modern design with a user-friendly interface. The app features a
**🌐 OPEN-SOURCE TRANSPARENCY:**
Power Ampache app is completely free of ads and does not request unnecessary permissions. Moreover, it is fully open-source, providing you with peace of mind, as you have access to the source code for security and privacy audits.

## FDroid and PlayStore links coming soon (Expected Release Date May 1)
## PlayStore version coming soon

[<img src="https://s1.ax1x.com/2023/01/12/pSu1a36.png" alt="Get it on GitHub" height="80">](https://github.com/icefields/Power-Ampache-2/releases)

[<img src="https://s1.ax1x.com/2023/01/12/pSnTZ0f.png"
alt="Get it on Telegram Channel"
height="80">](https://t.me/powerampache)
<!--
alt="Get it on Telegram Channel"
height="80">](https://t.me/powerampache)

[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/luci.sixsixsix/)
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/luci.sixsixsix.powerampache2.fdroid/)

F-Droid releases can not upgrade to other releases and it is compiled, signed and distributed uniformly by [F-Droid](https://f-droid.org/docs/FAQ_-_General/).
Github, PlayStore and Telegram releases are signed by me.

<!--
➡️ Explore more apps: https://www..org<br>
➡️ Open-Source Code: https://www.github.com/<br>
➡️ Join the community on Reddit: https://www.reddit.com/r/<br>
Expand All @@ -154,15 +155,15 @@ You can select a demo instance from the login screen or login into your own serv

## Translations
The app is currently translated in the following languages:
- English
- Czech
<br>
Work in progress:
- French
- Italian
- Japanese
<br>
In the future I will automate translation contributions, right now you have 3 options.<br>
English
Czech

Work in progress:
French
Italian
Japanese
<br>
In the future I will automate translation contributions, right now you have 3 options.<br>
- If you're an Android developer just create the resource directories and files and open a PR (`strings.xml` is where translatable strings are located).
- If you're not familiar with Android development and don't know how to create translation resources, but you are able to edit XML files: you can just grab `strings.xml`, edit it and send it back to me. I'll review it and will include it in the app in the next release.
Example (italian translation):
Expand Down
Binary file modified app/Github/release/app-Github-release.apk
Binary file not shown.
Binary file modified app/Github/release/baselineProfiles/0/app-Github-release.dm
Binary file not shown.
Binary file modified app/Github/release/baselineProfiles/1/app-Github-release.dm
Binary file not shown.
4 changes: 2 additions & 2 deletions app/Github/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 55,
"versionName": "1.00-55",
"versionCode": 56,
"versionName": "1.00-56",
"outputFile": "app-Github-release.apk"
}
],
Expand Down
16 changes: 13 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,27 @@ android {
val ampacheUser = properties.getProperty("AMPACHE_USER")
val ampachePass = properties.getProperty("AMPACHE_PASSWORD")
val ampacheUrl = properties.getProperty("AMPACHE_URL")
val ampacheUrlLocal = properties.getProperty("LOCAL_STABLE_URL")
val dogmazicPass = properties.getProperty("DOGMAZIC_PASSWORD")
val dogmazicUser = properties.getProperty("DOGMAZIC_USER")
val dogmazicEmail = properties.getProperty("DOGMAZIC_EMAIL")
val errorLogUrl = properties.getProperty("URL_ERROR_LOG")
val localDevUser = properties.getProperty("LOCAL_DEV_USER")
val localDevPass = properties.getProperty("LOCAL_DEV_PASSWORD")
val localDevUrl = properties.getProperty("LOCAL_DEVELOPMENT_URL")
val errorReportEmail = properties.getProperty("ERROR_REPORT_EMAIL")
val pastebinApiKey = properties.getProperty("PASTEBIN_API_KEY")
val localNextcloudUser = properties.getProperty("LOCAL_NEXTCLOUD_USER")
val localNextcloudPass = properties.getProperty("LOCAL_NEXTCLOUD_PASSWORD")
val localNextcloudUrl = properties.getProperty("LOCAL_NEXTCLOUD_URL")

defaultConfig {
applicationId = "luci.sixsixsix.powerampache2"
minSdk = 28
targetSdk = 34
versionCode = 55
versionName = "1.00-55"
val versionQuote = "This version is powered by the beginning of the music revolution (FDroid second release)"
versionCode = 56
versionName = "1.00-56"
val versionQuote = "This version is powered by financial debt"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

Expand All @@ -65,6 +70,11 @@ android {

buildConfigField("String", "VERSION_QUOTE", "\"$versionQuote\"")
buildConfigField("String", "ERROR_REPORT_EMAIL", errorReportEmail)
buildConfigField("String", "LOCAL_NEXTCLOUD_USER", localNextcloudUser)
buildConfigField("String", "LOCAL_NEXTCLOUD_PASSWORD", localNextcloudPass)
buildConfigField("String", "LOCAL_NEXTCLOUD_URL", localNextcloudUrl)
buildConfigField("String", "DEBUG_LOCAL_STABLE_URL", ampacheUrlLocal)
buildConfigField("String", "DEBUG_LOCAL_DEVELOPMENT_URL", localDevUrl)
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ object Constants {
const val DATABASE_LIMIT_ELEMENTS = 66
const val QUICK_PLAY_MIN_SONGS = 50
const val USER_ACCESS_DEFAULT = 25
const val USER_EMAIL_DEFAULT = "" //""[email protected]"
const val USER_EMAIL_DEFAULT = ""
const val USER_FULL_NAME_PUBLIC_DEFAULT = 0
const val PLAYLIST_FETCH_LIMIT = 50
const val NETWORK_REQUEST_LIMIT_ARTISTS = 30
const val NETWORK_REQUEST_LIMIT_SONGS = 40
const val NETWORK_REQUEST_LIMIT_SONGS_SEARCH = 100
Expand All @@ -65,7 +64,6 @@ object Constants {
const val USER_ID_ERROR = ERROR_INT

// FLAGS
const val RESET_QUEUE_ON_NEW_SESSION = BuildConfig.RESET_QUEUE_ON_NEW_SESSION
const val CLEAR_TABLE_AFTER_FETCH = false
const val ALWAYS_FETCH_ALL_PLAYLISTS = true

Expand All @@ -92,4 +90,8 @@ object Constants {
const val DOGMAZIC_FAKE_USERNAME = "PowerAmpache"
const val DOGMAZIC_FAKE_STATE = "Ehime"
const val DOGMAZIC_FAKE_CITY = "Aoshima"

// fetch this from remote config or initialize locally
const val CONFIG_URL = "https://icefields.github.io/powerampache/config.json"
var config = Pa2Config()
}
39 changes: 0 additions & 39 deletions app/src/main/java/luci/sixsixsix/powerampache2/common/Event.kt

This file was deleted.

45 changes: 45 additions & 0 deletions app/src/main/java/luci/sixsixsix/powerampache2/common/Pa2Config.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Copyright (C) 2024 Antonio Tari
*
* This file is a part of Power Ampache 2
* Ampache Android client application
* @author Antonio Tari
*
* This program 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.
*
* This program 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 this program. If not, see <http:https://www.gnu.org/licenses/>.
*
*/
package luci.sixsixsix.powerampache2.common

import luci.sixsixsix.powerampache2.BuildConfig

const val PLAYLIST_FETCH_LIMIT = 100
const val PLAYLIST_ADD_NEW_ENABLE = true
const val RESET_QUEUE_ON_NEW_SESSION = BuildConfig.RESET_QUEUE_ON_NEW_SESSION
const val DOGMAZIC_USER = BuildConfig.DOGMAZIC_USER

data class Pa2Config(
// use new fast method for adding albums and playlists to playlist
val playlistAddNewEnable: Boolean = PLAYLIST_ADD_NEW_ENABLE,

// reset queue on new session
val queueResetOnNewSession: Boolean = RESET_QUEUE_ON_NEW_SESSION,

val dogmazicDemoUser: String = DOGMAZIC_USER,

// limit of songs to fetch for playlists
// - bigger number results in faster fetching
// - smaller number will result in data becoming visible to the user faster, but it will
// take longer to completely fetch big playlists
val playlistSongsFetchLimit: Int = PLAYLIST_FETCH_LIMIT,
)

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ abstract class BaseAmpacheRepository(
private val errHandler: ErrorHandler
) {
protected val dao = db.dao
//protected var offlineModeEnabledLiveData = dao.offlineModeEnabled().distinctUntilChanged().map { it == true }

val settingsLiveData: LiveData<LocalSettings?>
get() = dao.settingsLiveData().distinctUntilChanged().map {
Expand Down Expand Up @@ -135,7 +134,6 @@ abstract class BaseAmpacheRepository(
}
}


protected suspend fun cacheSongs(songs: List<Song>) {
val credentials = getCurrentCredentials()
dao.insertSongs(songs.map { it.toSongEntity(username = credentials.username, serverUrl = credentials.serverUrl) })
Expand Down Expand Up @@ -176,7 +174,6 @@ abstract class BaseAmpacheRepository(
MainNetwork.Type.playlist -> dao.getAllPlaylists()
.firstOrNull { it.id == id}?.copy(flag = flag)?.let { dbPlaylist ->
dao.insertPlaylists(listOf(dbPlaylist))
L("like inserted")
}
}
if (!isOfflineModeEnabled()) {
Expand Down
Loading

0 comments on commit db4cc6f

Please sign in to comment.