VDSoft / TheTVDBApi

A .NET api for the TheTVDB.com database
GNU General Public License v3.0
5 stars 8 forks source link

wrong values for all episode and season numbers #10

Closed DanCooper closed 9 years ago

DanCooper commented 9 years ago

The API returns always "0" for all episode and season numbers, even the value are not set in XML.

Example:

-> the API returns 0 -> the API returns 0 The API returns also "0" if the node is missing in XML. It should be -1 or nothing.
ChristophvdF commented 9 years ago

Sorry but I can't reproduce the error described by you. When ever I request a series i receive all season and episode numbers. Could you please provide me some more information, like which method you are calling and which parameters are provided. So I can investigate it more detailed. Thx in advance.

DanCooper commented 9 years ago

Oh sorry, GitHub has removed the node informations that i have wrote my comment ;-)

I try it again: Your API give always back "0", even if there is NO value set for a node or the node is MISSING in XML. Expample:

<airsbefore_episode></airsbefore_episode>

API gives back "0" and that's wrong and should be NOTHING/NULL or -1, same if the node is completly missing in XML. I have this issue with all episode and season numbers.

ChristophvdF commented 9 years ago

Ok now it makes more sense ;-) Yeah the default values for the fields are:

<airsafter_season> = null (string)
<airsbefore_episode> = 0 (int)
<airsbefore_season> = 0 (int)

I can change them to become

<airsafter_season> = null (string)
<airsbefore_episode> = -1 (int)
<airsbefore_season> = -1 (int)

null with the ints needs to change the type from int to int? and that would need some more checking in the code... Is this as a quick fix ok for you?

Could you please provide me with a series where all three of the fields are set. Each series I am requesting only has set the "airsbefore_episode" and "airsbefore_season" fields.

Please note also that I am currently working on some potential issues with the api regarding multi threading. So i will not build a nuget package with this fix, please include the project within your solution.

DanCooper commented 9 years ago

Yes, -1 (int) is OK and works for all this fields. But it's not only a problem with the "airs..." fields, we have the same problem with all other episode and season numbers (int) like

<Combined_episodenumber>
<Combined_season>
<DVD_chapter>
<DVD_discid>
<DVD_episodenumber>
<DVD_season>
<absolute_number>
...

An episode can only have "airesbefore_episode" AND "airesbefore_season" OR "airesafter_season". If a special episode was aired between two regular episodes, you need the episode number and season number. If a special episode was aired after a season, you need only the season number.

Example for "airesbefore_*": http://thetvdb.com/?tab=episode&seriesid=75978&seasonid=23437&id=557261&lid=14

Example for "airesafter_season": http://thetvdb.com/?tab=episode&seriesid=75978&seasonid=23437&id=415704&lid=14

And why is "airesafter_season" a string? That can only be a (season) number.

DanCooper commented 9 years ago

Oh, I just saw that you come probably from Austria. I am from Switzerland, possibly to communicate in German would be easier.

ChristophvdF commented 9 years ago

Thx for the links, I will check these episodes and fix the problem. I also will change the default values of all ints to -1 so there should be no problem by checking/sorting the episodes correctly. Your fix should be done by today ;-) Maybe there will be a new nuget pack, I'll keep you posted!

Regarding the conversation in German, I would like to keep all discussions on GitHub in English so that everyone here can read and understand them.

DanCooper commented 9 years ago

Thank you!

ChristophvdF commented 9 years ago

Your changes have been pushed. See commits: https://github.com/VDSoft/TheTVDBApi/commit/e4c6be9fa1c42e717f0410588b1af17f9336d5be https://github.com/VDSoft/TheTVDBApi/commit/cf1b43465cc8b07bc7079838868fc2861fdf90c9

Please verify them and close the issue if everything is working. Btw. I would really love to know for what project you are using the API. When you don't mind just contact me at office@vdsoft.at

ChristophvdF commented 9 years ago

Is everything working as expected?

DanCooper commented 9 years ago

I've merged you latest "master" branch, but still i get "0" for all values.

Edit: wait, maybe the old API is still loaded... i will check that

ChristophvdF commented 9 years ago

Sometimes the api provides you with a "0". The episode of Family guy you sent me provided 0 at the entries:

CombinedSeason
SeasonNumber
Thumbadded

All other values should ether be -1 or > 0 Also i haven't build a new nuget pack for now, please keep that in mind.

DanCooper commented 9 years ago

Now i've tested with some episodes and it looks great.

For the first episode i've linked (S00E10) it's correct that some values are "0". Season Specials are always "SeasonNumber = 0", also "CombinedSeason = 0". I don't use " Thumbadded so i can't say if that is correct.

In my opinion, that can go to NuGet :-)

ChristophvdF commented 9 years ago

ok thx, I need to check some issues with async work in the api, after that i will build a nuget pack :-)