Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build bug and fix bug #306

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ import org.akanework.gramophone.logic.utils.LrcUtils.loadAndParseLyricsFile
import org.akanework.gramophone.logic.utils.LrcUtils.loadAndParseLyricsFileLegacy
import org.akanework.gramophone.logic.utils.MediaStoreUtils
import org.akanework.gramophone.logic.utils.SemanticLyrics
import org.akanework.gramophone.logic.utils.convertForLegacy
import org.akanework.gramophone.logic.utils.exoplayer.EndedWorkaroundPlayer
import org.akanework.gramophone.logic.utils.exoplayer.GramophoneMediaSourceFactory
import org.akanework.gramophone.logic.utils.exoplayer.GramophoneRenderFactory
Expand Down Expand Up @@ -795,8 +796,8 @@ class GramophonePlaybackService : MediaLibraryService(), MediaSessionService.Lis

fun updateLyrics(parsedLyrics: MutableList<MediaStoreUtils.Lyric>?, parsedLyricsa: SemanticLyrics?) {
if ( parsedLyrics.toString() == "null" ){
lyricsLegacy = SemanticLyrics.convertForLegacy(parsedLyricsa)
adapter?.updateLyrics(lyricsLegacy)
lyrics = parsedLyricsa
adapter?.updateLyrics(lyrics.convertForLegacy())
newView?.updateLyrics(null)
} else {
lyricsLegacy = parsedLyrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ class ExperimentalSettingsTopFragment : BasePreferenceFragment() {

private fun checkAndRequestNotificationPermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
if (!isAdded) {
// Fragment 未附着,推迟操作或记录日志
Log.e("Fragment", "Fragment not attached to context yet")
return
}
when {
ActivityCompat.checkSelfPermission(
requireContext(),
Expand Down