You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

110 lines
2.2 KiB

  1. /*
  2. * This program is free software: you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation, either version 3 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <https://www.gnu.org/licenses/>.
  12. *
  13. * [email protected] 2019
  14. */
  15. #ifndef MODELS_H
  16. #define MODELS_H
  17. #include <QString>
  18. #include <QUrl>
  19. #include <QVector>
  20. typedef struct api_error_s{
  21. bool error;
  22. QString code;
  23. QString message;
  24. }api_error_t;
  25. typedef struct api_status_s{
  26. bool failed;
  27. bool api_error;
  28. QString description;
  29. }api_status_t;
  30. typedef struct session_s{
  31. QString id;
  32. QString country;
  33. }session_t;
  34. typedef struct user_s{
  35. bool premium;
  36. QString username;
  37. QString session_id;
  38. }user_t;
  39. typedef struct stream_s{
  40. QString quality;
  41. QUrl url;
  42. }stream_t;
  43. typedef struct query_s{
  44. QString series_id;
  45. QString name;
  46. QUrl thumbnail;
  47. QString description;
  48. }query_t;
  49. typedef struct collection_s{
  50. QString collection_id;
  51. QString name;
  52. QString season;
  53. QString description;
  54. }collection_t;
  55. typedef struct meta_episode_s{
  56. QString media_id;
  57. int number;
  58. QString name;
  59. QString description;
  60. QUrl thumbnail;
  61. bool available;
  62. bool free_available;
  63. //unused by crunchyrollapi.h:
  64. collection_t collection;
  65. }meta_episode_t;
  66. typedef struct episode_s{
  67. int number;
  68. QString name;
  69. QString collectionname;
  70. QString seriesname;
  71. QString description;
  72. QUrl thumbnail;
  73. bool available;
  74. bool premium_only;
  75. int duration;
  76. QString subtitle_lang;
  77. QString audio_lang;
  78. QVector<stream_t> streams;
  79. //unused by crunchyrollapi.h; only used for progressview.h compat.:
  80. collection_t collection;
  81. }episode_t;
  82. //code below unused by crunchyrollapi.h
  83. enum class quality{
  84. best,
  85. p1080,
  86. p720,
  87. p480,
  88. p360,
  89. p240
  90. };
  91. #endif // MODELS_H