2021-10-27 23:00:01 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Selector.Cache
|
|
|
|
|
{
|
|
|
|
|
public class Key
|
|
|
|
|
{
|
|
|
|
|
public const string CurrentlyPlayingName = "CurrentlyPlaying";
|
2021-11-05 18:41:45 +00:00
|
|
|
|
|
2021-10-29 22:35:34 +01:00
|
|
|
|
public const string TrackName = "Track";
|
2021-11-05 18:41:45 +00:00
|
|
|
|
public const string AlbumName = "Album";
|
|
|
|
|
public const string ArtistName = "Artist";
|
2021-11-29 21:04:15 +00:00
|
|
|
|
public const string UserName = "User";
|
2021-11-05 18:41:45 +00:00
|
|
|
|
|
2021-10-29 22:35:34 +01:00
|
|
|
|
public const string AudioFeatureName = "AudioFeature";
|
2021-11-05 18:41:45 +00:00
|
|
|
|
public const string PlayCountName = "PlayCount";
|
2021-10-27 23:00:01 +01:00
|
|
|
|
|
2021-11-03 17:38:54 +00:00
|
|
|
|
public const string WorkerName = "Worker";
|
2021-11-10 09:15:39 +00:00
|
|
|
|
public const string WatcherName = "Watcher";
|
|
|
|
|
public const string ReservedName = "Reserved";
|
2021-11-03 17:38:54 +00:00
|
|
|
|
|
2021-11-05 18:41:45 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Current playback for a user
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="user">User's database Id (Guid)</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static string CurrentlyPlaying(string user) => Namespace(user, CurrentlyPlayingName);
|
|
|
|
|
public static string AudioFeature(string trackId) => Namespace(TrackName, trackId, AudioFeatureName);
|
|
|
|
|
|
|
|
|
|
public static string TrackPlayCount(string name, string artist) => Namespace(TrackName, artist, name, PlayCountName);
|
|
|
|
|
public static string AlbumPlayCount(string name, string artist) => Namespace(AlbumName, artist, name, PlayCountName);
|
|
|
|
|
public static string ArtistPlayCount(string name) => Namespace(ArtistName, name, PlayCountName);
|
2021-11-29 21:04:15 +00:00
|
|
|
|
public static string UserPlayCount(string username) => Namespace(UserName, username, PlayCountName);
|
2021-10-27 23:00:01 +01:00
|
|
|
|
|
2021-11-10 09:15:39 +00:00
|
|
|
|
public static string WatcherReserved(int id) => Namespace(WatcherName, id.ToString(), ReservedName);
|
|
|
|
|
|
2021-11-05 18:41:45 +00:00
|
|
|
|
public static string Namespace(params string[] args) => string.Join(":", args);
|
2021-10-27 23:00:01 +01:00
|
|
|
|
}
|
|
|
|
|
}
|