Debug update a playlist
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using BeatSaberPlaylistsLib.Types;
|
||||
using UnityEngine;
|
||||
#if false
|
||||
using BeatLeader.Utils;
|
||||
@@ -71,7 +72,7 @@ namespace Setlist
|
||||
/// ownership from playlist JSON. Must be called from the Unity main thread (BSIPA <c>OnApplicationStart</c> is fine).
|
||||
/// </summary>
|
||||
internal static void ScheduleVerifyAndLog(
|
||||
List<(string Title, bool HasSyncUrl, string BeatLeaderGuid, string OwnerId)> entries,
|
||||
List<(IPlaylist Playlist, string Title, bool HasSyncUrl, string BeatLeaderGuid, string OwnerId)> entries,
|
||||
IPALogger log)
|
||||
{
|
||||
var go = new GameObject("Setlist.OwnershipRunner");
|
||||
@@ -86,11 +87,11 @@ namespace Setlist
|
||||
/// </summary>
|
||||
private sealed class OwnershipRunner : MonoBehaviour
|
||||
{
|
||||
private List<(string Title, bool HasSyncUrl, string BeatLeaderGuid, string OwnerId)> _entries;
|
||||
private List<(IPlaylist Playlist, string Title, bool HasSyncUrl, string BeatLeaderGuid, string OwnerId)> _entries;
|
||||
private IPALogger _log;
|
||||
|
||||
public void Initialize(
|
||||
List<(string Title, bool HasSyncUrl, string BeatLeaderGuid, string OwnerId)> entries,
|
||||
List<(IPlaylist Playlist, string Title, bool HasSyncUrl, string BeatLeaderGuid, string OwnerId)> entries,
|
||||
IPALogger log)
|
||||
{
|
||||
_entries = entries;
|
||||
@@ -116,6 +117,23 @@ namespace Setlist
|
||||
platformUserId));
|
||||
}
|
||||
|
||||
foreach (var e in _entries)
|
||||
{
|
||||
if (!string.Equals(e.Title, BeatLeaderPlaylistUpdateTest.TargetPlaylistTitle, StringComparison.Ordinal))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
yield return BeatLeaderPlaylistUpdateTest.RunIfTargetOwned(
|
||||
e.Playlist,
|
||||
e.HasSyncUrl,
|
||||
e.BeatLeaderGuid,
|
||||
e.OwnerId,
|
||||
platformUserId,
|
||||
_log);
|
||||
break;
|
||||
}
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user