Esempio n. 1
0
 protected virtual void ValidateSongSearchResponse(SongSearchResponse response, LyricDownloaderArgs args)
 {
     if (response.ErrorCode != 0 && response.Status != 1 || response.Data.List == null)
     {
         throw new ErrorCodeException(ErrorCodes.NoMatchingSong, attachObj: args);
     }
 }
Esempio n. 2
0
        protected virtual void ValidateSongSearchResponse(SongSearchResponse response, LyricDownloaderArgs args)
        {
            if (response?.StatusCode != SongSearchResponseStatusCode.Success)
            {
                throw new ErrorCodeException(ErrorCodes.TheReturnValueIsIllegal, attachObj: args);
            }

            if (response.Items?.SongCount <= 0)
            {
                throw new ErrorCodeException(ErrorCodes.NoMatchingSong, attachObj: args);
            }
        }
 protected virtual void ValidateSongSearchResponse(SongSearchResponse response, LyricDownloaderArgs args)
 {
     if (response is not {
         StatusCode : 0
     } || response.Data.Song.SongItems == null)