mirror of
https://github.com/zoriya/Opus.git
synced 2025-12-06 06:26:15 +00:00
Solving some bugs.
This commit is contained in:
@@ -69,6 +69,9 @@ namespace Opus.Api
|
||||
/// <param name="folderPath">The path of a folder if you want to shuffle files from this folder only.</param>
|
||||
public async static void ShuffleAll(string folderPath = null)
|
||||
{
|
||||
if (!await MainActivity.instance.GetReadPermission())
|
||||
return;
|
||||
|
||||
List<Song> songs = new List<Song>();
|
||||
|
||||
await Task.Run(() =>
|
||||
|
||||
@@ -171,8 +171,14 @@ namespace Opus
|
||||
protected override void OnStart()
|
||||
{
|
||||
base.OnStart();
|
||||
CastContext = CastContext.GetSharedInstance(this);
|
||||
CastContext.SessionManager.AddSessionManagerListener(this);
|
||||
|
||||
if (GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(this) == ConnectionResult.Success)
|
||||
{
|
||||
CastContext = CastContext.GetSharedInstance(this);
|
||||
CastContext.SessionManager.AddSessionManagerListener(this);
|
||||
}
|
||||
else
|
||||
CastContext = null;
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
@@ -181,7 +187,7 @@ namespace Opus
|
||||
Paused = false;
|
||||
instance = this;
|
||||
|
||||
if (CastContext.SessionManager.CurrentSession == null && MusicPlayer.CurrentID() == -1)
|
||||
if ((CastContext == null || CastContext.SessionManager.CurrentSession == null) && MusicPlayer.CurrentID() == -1)
|
||||
MusicPlayer.currentID = MusicPlayer.RetrieveQueueSlot();
|
||||
else if (MusicPlayer.UseCastPlayer)
|
||||
MusicPlayer.GetQueueFromCast();
|
||||
|
||||
Reference in New Issue
Block a user