mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-23 04:43:07 +00:00
Merge branch 'develop' into feature/navigation
This commit is contained in:
commit
0f72f6383d
9 changed files with 24 additions and 24 deletions
|
@ -1,8 +1,10 @@
|
|||
package de.nicidienase.chaosflix.common
|
||||
|
||||
import androidx.annotation.Keep
|
||||
import de.nicidienase.chaosflix.common.eventimport.FahrplanLecture
|
||||
import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Event
|
||||
|
||||
@Keep
|
||||
data class ImportItem(
|
||||
val lecture: FahrplanLecture,
|
||||
var event: Event?,
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package de.nicidienase.chaosflix.common.eventimport
|
||||
|
||||
import androidx.annotation.Keep
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Keep
|
||||
data class FahrplanLecture(
|
||||
@SerializedName("lecture_id")
|
||||
var lectureId: String? = null,
|
||||
|
|
|
@ -22,13 +22,13 @@ import de.nicidienase.chaosflix.common.userdata.entities.watchlist.WatchlistItem
|
|||
import de.nicidienase.chaosflix.common.util.ConferenceUtil
|
||||
import de.nicidienase.chaosflix.common.util.LiveEvent
|
||||
import de.nicidienase.chaosflix.common.util.SingleLiveEvent
|
||||
import java.io.IOException
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import retrofit2.Response
|
||||
import java.io.IOException
|
||||
|
||||
class MediaRepository(
|
||||
private val recordingApi: RecordingService,
|
||||
|
|
|
@ -17,16 +17,16 @@ import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.
|
|||
import de.nicidienase.chaosflix.common.userdata.entities.watchlist.WatchlistItem
|
||||
import de.nicidienase.chaosflix.common.util.LiveEvent
|
||||
import de.nicidienase.chaosflix.common.util.SingleLiveEvent
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.File
|
||||
import java.util.ArrayList
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class DetailsViewModel(
|
||||
private val database: ChaosflixDatabase,
|
||||
private val offlineItemManager: OfflineItemManager,
|
||||
private val preferencesManager: PreferencesManager,
|
||||
private val mediaRepository: MediaRepository
|
||||
private val database: ChaosflixDatabase,
|
||||
private val offlineItemManager: OfflineItemManager,
|
||||
private val preferencesManager: PreferencesManager,
|
||||
private val mediaRepository: MediaRepository
|
||||
) : ViewModel() {
|
||||
|
||||
private var eventId: Long = 0
|
||||
|
@ -77,9 +77,9 @@ class DetailsViewModel(
|
|||
return mediaRepository.getEvent(eventId)
|
||||
}
|
||||
|
||||
private fun loadEvent(eventProvider: suspend ()->Event?): LiveData<Event?> = liveData{
|
||||
private fun loadEvent(eventProvider: suspend () -> Event?): LiveData<Event?> = liveData {
|
||||
val event = eventProvider.invoke()
|
||||
if(event != null){
|
||||
if (event != null) {
|
||||
emit(event)
|
||||
emitSource(setEventId(event.id))
|
||||
} else {
|
||||
|
@ -233,7 +233,7 @@ class DetailsViewModel(
|
|||
|
||||
fun play(autoselect: Boolean = autoselectRecording) = viewModelScope.launch(Dispatchers.IO) {
|
||||
if (autoselect) {
|
||||
mediaRepository.getEventSync(eventId)?.let {event ->
|
||||
mediaRepository.getEventSync(eventId)?.let { event ->
|
||||
val recordings = database.recordingDao().findRecordingByEventSync(eventId)
|
||||
val optimalRecording = ChaosflixUtil.getOptimalRecording(recordings, event.originalLanguage)
|
||||
val recordingUrl = ChaosflixUtil.getRecordingForThumbs(recordings)?.recordingUrl
|
||||
|
|
|
@ -5,9 +5,9 @@ import androidx.lifecycle.ViewModel
|
|||
import androidx.lifecycle.viewModelScope
|
||||
import de.nicidienase.chaosflix.common.ChaosflixDatabase
|
||||
import de.nicidienase.chaosflix.common.userdata.entities.progress.PlaybackProgress
|
||||
import java.util.Date
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import java.util.Date
|
||||
|
||||
class PlayerViewModel(val database: ChaosflixDatabase) : ViewModel() {
|
||||
|
||||
|
@ -21,7 +21,7 @@ class PlayerViewModel(val database: ChaosflixDatabase) : ViewModel() {
|
|||
database.playbackProgressDao().getProgressForEvent(eventGuid)
|
||||
|
||||
suspend fun getPlaybackProgress(): PlaybackProgress? {
|
||||
return if(eventGuid.isNotBlank()){
|
||||
return if (eventGuid.isNotBlank()) {
|
||||
database.playbackProgressDao().getProgressForEventSync(eventGuid)
|
||||
} else {
|
||||
null
|
||||
|
@ -42,7 +42,7 @@ class PlayerViewModel(val database: ChaosflixDatabase) : ViewModel() {
|
|||
}
|
||||
|
||||
fun deletePlaybackProgress() {
|
||||
if(eventGuid.isNotBlank()) {
|
||||
if (eventGuid.isNotBlank()) {
|
||||
viewModelScope.launch(Dispatchers.IO) {
|
||||
database.playbackProgressDao().deleteItem(eventGuid)
|
||||
}
|
||||
|
|
|
@ -259,7 +259,6 @@ class EventDetailsFragment : DetailsSupportFragment() {
|
|||
rowsAdapter.add(detailsOverview)
|
||||
setThumb(event.thumbUrl, detailsOverview)
|
||||
|
||||
|
||||
var relatedEventsAdapter: ArrayObjectAdapter? = null
|
||||
detailsViewModel.getRelatedEvents().observe(viewLifecycleOwner, Observer { events ->
|
||||
if (relatedEventsAdapter == null) {
|
||||
|
|
|
@ -37,12 +37,12 @@ android {
|
|||
signingConfigs {
|
||||
//noinspection GroovyMissingReturnStatement, GroovyAssignabilityCheck
|
||||
release {
|
||||
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
|
||||
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore.trim()).exists() && file(chaosflixKeystore.trim()).isFile()) {
|
||||
println "Release app signing is configured: will sign APK"
|
||||
storeFile file(chaosflixKeystore)
|
||||
storePassword chaosflixStorePassword
|
||||
keyAlias chaosflixKeyName
|
||||
keyPassword chaosflixKeyPassword
|
||||
storeFile file(chaosflixKeystore.trim())
|
||||
storePassword chaosflixStorePassword.trim()
|
||||
keyAlias chaosflixKeyName.trim()
|
||||
keyPassword chaosflixKeyPassword.trim()
|
||||
} else {
|
||||
println "App signing data not found. Will not sign."
|
||||
}
|
||||
|
@ -60,8 +60,7 @@ android {
|
|||
shrinkResources true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
||||
'proguard-rules.pro'
|
||||
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore).exists() && file(chaosflixKeystore).isFile()) {
|
||||
|
||||
if (project.hasProperty("chaosflixKeystore") && file(chaosflixKeystore.trim()).exists() && file(chaosflixKeystore.trim()).isFile()) {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ class ConferenceGroupFragment : Fragment() {
|
|||
private val columnCount: Int by lazy { resources.getInteger(R.integer.num_columns) }
|
||||
private val conferenceGroup: ConferenceGroup by lazy { arguments?.getParcelable<ConferenceGroup>(ARG_GROUP)!! }
|
||||
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
val view = inflater.inflate(R.layout.fragment_conferences_page, container, false)
|
||||
if (view is RecyclerView) {
|
||||
|
@ -92,4 +91,3 @@ class ConferenceGroupFragment : Fragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.6.0
|
||||
0.7.0
|
||||
|
|
Loading…
Reference in a new issue