Skip to content

Commit

Permalink
fix build bug and fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ghhccghk committed Oct 25, 2024
1 parent 960bf7e commit 9861b58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit 9861b58

Please sign in to comment.