diff --git a/app/src/main/java/org/oxycblt/auxio/AuxioService.kt b/app/src/main/java/org/oxycblt/auxio/AuxioService.kt index fd44f6a5b..64121e6d1 100644 --- a/app/src/main/java/org/oxycblt/auxio/AuxioService.kt +++ b/app/src/main/java/org/oxycblt/auxio/AuxioService.kt @@ -28,8 +28,6 @@ import dagger.hilt.android.AndroidEntryPoint import javax.inject.Inject import org.oxycblt.auxio.music.service.IndexerServiceFragment import org.oxycblt.auxio.playback.service.MediaSessionServiceFragment -import org.oxycblt.auxio.tasker.indicateServiceRunning -import org.oxycblt.auxio.tasker.indicateServiceStopped @AndroidEntryPoint class AuxioService : MediaLibraryService(), ForegroundListener { @@ -42,7 +40,6 @@ class AuxioService : MediaLibraryService(), ForegroundListener { super.onCreate() mediaSessionFragment.attach(this, this) indexingFragment.attach(this) - indicateServiceRunning() } override fun onBind(intent: Intent?): IBinder? { @@ -73,7 +70,6 @@ class AuxioService : MediaLibraryService(), ForegroundListener { override fun onDestroy() { super.onDestroy() - indicateServiceStopped() indexingFragment.release() mediaSessionFragment.release() } diff --git a/app/src/main/java/org/oxycblt/auxio/music/MusicViewModel.kt b/app/src/main/java/org/oxycblt/auxio/music/MusicViewModel.kt index afcb572bf..99e3fee4d 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/MusicViewModel.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/MusicViewModel.kt @@ -164,8 +164,10 @@ constructor( } val deviceLibrary = musicRepository.deviceLibrary ?: return@launch - val songs = importedPlaylist.paths.mapNotNull { - it.firstNotNullOfOrNull(deviceLibrary::findSongByPath) } + val songs = + importedPlaylist.paths.mapNotNull { + it.firstNotNullOfOrNull(deviceLibrary::findSongByPath) + } if (songs.isEmpty()) { logE("No songs found") diff --git a/app/src/main/java/org/oxycblt/auxio/music/external/M3U.kt b/app/src/main/java/org/oxycblt/auxio/music/external/M3U.kt index 28a391c27..ddb174d5e 100644 --- a/app/src/main/java/org/oxycblt/auxio/music/external/M3U.kt +++ b/app/src/main/java/org/oxycblt/auxio/music/external/M3U.kt @@ -122,48 +122,54 @@ class M3UImpl @Inject constructor(@ApplicationContext private val context: Conte // the same volume as the M3U file. There's no sane way to map the volume // to the phone's volumes, so this is the only thing we can do. val absoluteInterpretation = Components.parseUnix(path) - val relativeInterpretation = absoluteInterpretation.absoluteTo(workingDirectory.components) + val relativeInterpretation = + absoluteInterpretation.absoluteTo(workingDirectory.components) listOf(absoluteInterpretation, relativeInterpretation) } - path.startsWith("./") -> { // Unix relative path, resolve it val absoluteInterpretation = Components.parseUnix(path) - val relativeInterpretation = absoluteInterpretation.absoluteTo(workingDirectory.components) + val relativeInterpretation = + absoluteInterpretation.absoluteTo(workingDirectory.components) listOf(relativeInterpretation, absoluteInterpretation) } - path.matches(WINDOWS_VOLUME_PREFIX_REGEX) -> { // Windows absolute path, we should get rid of the volume prefix, but // otherwise the rest should be fine. Again, we have to disregard what the - // volume actually is since there's no sane way to map it to the phone's volumes. + // volume actually is since there's no sane way to map it to the phone's + // volumes. val absoluteInterpretation = Components.parseWindows(path.substring(2)) - val relativeInterpretation = absoluteInterpretation.absoluteTo(workingDirectory.components) + val relativeInterpretation = + absoluteInterpretation.absoluteTo(workingDirectory.components) listOf(absoluteInterpretation, relativeInterpretation) } - path.startsWith("\\") -> { // Weird unix/windows hybrid absolute path that appears sometimes val absoluteInterpretation = Components.parseWindows(path) - val relativeInterpretation = absoluteInterpretation.absoluteTo(workingDirectory.components) + val relativeInterpretation = + absoluteInterpretation.absoluteTo(workingDirectory.components) listOf(absoluteInterpretation, relativeInterpretation) } - path.startsWith(".\\") -> { // Windows-style relative path val absoluteInterpretation = Components.parseWindows(path) - val relativeInterpretation = absoluteInterpretation.absoluteTo(workingDirectory.components) + val relativeInterpretation = + absoluteInterpretation.absoluteTo(workingDirectory.components) listOf(relativeInterpretation, absoluteInterpretation) } - else -> { // No clue, just go wild and assume all possible combinations. val unixAbsoluteInterpretation = Components.parseUnix(path) - val unixRelativeInterpretation = unixAbsoluteInterpretation.absoluteTo(workingDirectory.components) + val unixRelativeInterpretation = + unixAbsoluteInterpretation.absoluteTo(workingDirectory.components) val windowsAbsoluteInterpretation = Components.parseWindows(path) - val windowsRelativeInterpretation = windowsAbsoluteInterpretation.absoluteTo(workingDirectory.components) - listOf(unixRelativeInterpretation, unixAbsoluteInterpretation, - windowsRelativeInterpretation, windowsAbsoluteInterpretation) + val windowsRelativeInterpretation = + windowsAbsoluteInterpretation.absoluteTo(workingDirectory.components) + listOf( + unixRelativeInterpretation, + unixAbsoluteInterpretation, + windowsRelativeInterpretation, + windowsAbsoluteInterpretation) } }