Beispiel #1
0
        public static async Task <bool> DeleteTrackFollow(string userId, string trackId, bool ownerOverride = false)
        {
            try
            {
                TrackAuth track = await TrackRepository.GetTrack(trackId);

                if (track.PartitionKey == userId && ownerOverride == false)
                {
                    return(false);
                }

                UserFollowTableEntity userFollow = await TableStorageRepository.GetUserFollow(userId, trackId);

                TrackFollowTableEntity trackFollow = await TableStorageRepository.GetTrackFollow(trackId, userId);

                if (userFollow != null)
                {
                    await TableStorageRepository.DeleteUserFollow(userFollow);
                }

                if (trackFollow != null)
                {
                    await TableStorageRepository.DeleteTrackFollow(trackFollow);
                }

                return(true);
            }
            catch
            {
                return(false);
            }
        }
Beispiel #2
0
        public static async Task <TrackFollow> GetTrackFollow(string trackId, string userId)
        {
            TrackFollowTableEntity result = await TableStorageRepository.GetTrackFollow(trackId, userId);

            return(TableEntityToTrackFollow(result));
        }