* Provide better error messages with stacktrace
+ clean up
+ fix error details popup in MediaInfoFragment
* Simplify exception passing by sending complete exception to the dialog
* Use viewLifecycleOwner with repeatOnLifecycle
* Redesign settings to two pane layout
* Add downloads settings
* Suppress unused settings fragments warnings
* Fix download icon in other places
Also removes the filled download drawable
* Convert MediaFragment to use new UiState
* Convert PersonDetailFragment to use new UiState
* Load PersonDetail data on start
* Convert FavoriteFragment to use new UiState
* Convert SeasonFragment to use new UiState
* Convert SearchResultFragment to use new UiState
* Convert EpisodeBottomSheetFragment to use new UiState (WIP)
* Convert EpisodeBottomSheetFragment to use new UiState (Part 2)
* Convert LibraryFragment to use new UiState
* Convert DownloadFragment to use new UiState
* Convert HomeFragment to use new UiState
* Convert MediaInfoFragment to use new UiState (WIP)
* Convert MediaInfoViewModel to use new UiState (Part 2)
* Convert ServerSelectViewModel to use new UiState (Semi)
* Fix MediaInfoFragment for downloaded movies
* Fix download playback tracking bug
* Remove unused permission
* Add overview text to downloadmetadata
* Add visual indicator of whether item is downloaded
* Use downloaded item when available
* Fix "null" overview text in download metadata
* Fix crash when playing downloaded file with mpv
* Clean up
Co-authored-by: jarnedemeulemeester <jarnedemeulemeester@gmail.com>
* Add offline playback
* Remove unused values
* Replace downloadutilities extension functions with normal functions
This is to not polute the namespace of fragment and context.
* Replace default Android icons with those from lucide
* Fix deleting downloaded movie
Co-authored-by: Jarne Demeulemeester <32322857+jarnedemeulemeester@users.noreply.github.com>
* Refactor playback code
* Fix back state when playing media and rotating device
Problem was playerItems were re-emitted on fragment creation after config change. LiveData by design emit on every subscribe (observe) so to avoid that there are several possibilities.
1) easiest, observe playerItems not in onCreate but in playButton.clickListener. Stupid, since then we need to remember to only observe in this special place.
2) SingleLiveData - kind of hacky since LiveData were designed to behave this way so we don't want to go against their design.
3) Use Kotlin flow instead.
I chose the flow approach since it's Kotlin native and modern way to do things and behaves much more Rx-like. Since now we need to call collect instead of observe and launch in coroutine, I added utility method to make this easier. Also, in the future we might want to improve this further, either by coming up with new way entirely or by at least moving this to parent fragment from which all fragments that want to play media will inherit and thus making it easy to use and maintain.
Co-authored-by: Jarne Demeulemeester <32322857+jarnedemeulemeester@users.noreply.github.com>