ShokoAnime / ShokoServer

Repository for Shoko Server.
https://shokoanime.com/
MIT License
403 stars 74 forks source link

Exception when voting series #985

Closed t0815 closed 2 months ago

t0815 commented 5 years ago

VERSION INFORMATION

Server Version: 3.9.4.30902

Desktop Version: 3.9.4.0

LOG FILE

[2019-01-10 20:52:01:367] Error|RatingControl.OnRatingValueChanged => AnimeSeries.cRating_OnRatingValueChangedEvent => Utils.ShowErrorMessage System.AggregateException: One or more errors occurred. ---> Nancy.Rest.Client.Exceptions.RestClientException: 7.5 is not a valid value for Decimal. at Nancy.Rest.Client.Rest.SmallWebClient.<RestRequest>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Nancy.Rest.Client.ClientFactory.<>c__DisplayClass2_0.<<DoSyncClient>b__0>d.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Nancy.Rest.Client.ClientFactory.DoSyncClient(Object dexp, MethodDefinition def, IWebProxy proxy, Object[] parameters) at Nancy.Rest.Client.ClientFactory.<>cDisplayClass1_1`1.b__15(Object a, Object b, Object c) at CallSite.Target(Closure , CallSite , Object , Int32 , Decimal , Int32 ) at ActLike_IShokoServer_673012258df8497da7b6fb7279ad42e6.VoteAnime(Int32 animeID, Decimal voteValue, Int32 voteType) at Shoko.Desktop.UserControls.AnimeSeries.cRating_OnRatingValueChangedEvent(RatingValueEventArgs ev) in D:\Documents\GitHub\ShokoDesktop\Shoko.Desktop\UserControls\AnimeSeries.xaml.cs:line 1307 ---> (Inner Exception #0) Nancy.Rest.Client.Exceptions.RestClientException: 7.5 is not a valid value for Decimal. at Nancy.Rest.Client.Rest.SmallWebClient.d0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Nancy.Rest.Client.ClientFactory.<>c__DisplayClass2_0.<b__0>d.MoveNext()<---`

DESCRIPTION

Upon using the voting-widget you will get an exception when using floatingpoint number scores.

STEPS TO REPRODUCE

  1. Find anime not voted yet
  2. vote a score x.5
  3. (int score will work, to verify vote flat score)
Cazzar commented 2 years ago

If this is even happening still (also given da3dsoul’a anidb rewrite, we will also need server logs

t0815 commented 1 year ago

The exception has been fixed. But the score is somehow getting displayed as integer, thus converting 3.5 to 35. If its a flat vote like 3 it will stay 3

grafik

harshithmohan commented 2 months ago

Voting works properly in WebUI and it is out of 10, exactly how it's in the AniDB UI. So decimals are not supported and cannot be voted as such. Older decimal values will be converted to be out of 10 and rounded up if required. In this instance where older votes in desktop were 3.5 or 4.5 or whatever, they will be converted to 7 and 9 respectively.