SubtitleSearchParameters.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /* This file is part of OpenSubtitles Handler
  2. A library that handle OpenSubtitles.org XML-RPC methods.
  3. Copyright © Ala Ibrahim Hadid 2013
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. using System;
  16. namespace OpenSubtitlesHandler
  17. {
  18. /// <summary>
  19. /// Paramaters for subtitle search call
  20. /// </summary>
  21. public struct SubtitleSearchParameters
  22. {
  23. /// <summary>
  24. /// Paramaters for subtitle search call
  25. /// </summary>
  26. /// <param name="subLanguageId">List of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo')</param>
  27. /// <param name="movieHash">Video file hash as calculated by one of the implementation functions as seen on http://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes</param>
  28. /// <param name="movieByteSize">Size of video file in bytes </param>
  29. public SubtitleSearchParameters(string subLanguageId, string movieHash, long movieByteSize)
  30. {
  31. this.subLanguageId = subLanguageId;
  32. this.movieHash = movieHash;
  33. this.movieByteSize = movieByteSize;
  34. this.imdbid = "";
  35. this._episode = "";
  36. this._season = "";
  37. this._query = "";
  38. }
  39. public SubtitleSearchParameters(string subLanguageId, string query)
  40. {
  41. this.subLanguageId = subLanguageId;
  42. this.movieHash = "";
  43. this.movieByteSize = 0;
  44. this.imdbid = "";
  45. this._episode = "";
  46. this._season = "";
  47. this._query = query;
  48. }
  49. public SubtitleSearchParameters(string subLanguageId, string query, string season, string episode)
  50. {
  51. this.subLanguageId = subLanguageId;
  52. this.movieHash = "";
  53. this.movieByteSize = 0;
  54. this.imdbid = "";
  55. this._episode = episode;
  56. this._season = season;
  57. this._query = query;
  58. }
  59. /// <summary>
  60. /// Paramaters for subtitle search call
  61. /// </summary>
  62. /// <param name="subLanguageId">List of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo')</param>
  63. /// <param name="movieHash">Video file hash as calculated by one of the implementation functions as seen on http://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes</param>
  64. /// <param name="movieByteSize">Size of video file in bytes </param>
  65. /// <param name="imdbid"> IMDb ID of movie this video is part of, belongs to.</param>
  66. public SubtitleSearchParameters(string subLanguageId, string movieHash, long movieByteSize, string imdbid)
  67. {
  68. this.subLanguageId = subLanguageId;
  69. this.movieHash = movieHash;
  70. this.movieByteSize = movieByteSize;
  71. this.imdbid = imdbid;
  72. this._episode = "";
  73. this._season = "";
  74. this._query = "";
  75. }
  76. private string subLanguageId;
  77. private string movieHash;
  78. private long movieByteSize;
  79. private string imdbid;
  80. private string _query;
  81. private string _episode;
  82. public string Episode {
  83. get { return _episode; }
  84. set { _episode = value; }
  85. }
  86. public string Season {
  87. get { return _season; }
  88. set { _season = value; }
  89. }
  90. private string _season;
  91. public string Query {
  92. get { return _query; }
  93. set { _query = value; }
  94. }
  95. /// <summary>
  96. /// List of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo')
  97. /// </summary>
  98. public string SubLangaugeID { get { return subLanguageId; } set { subLanguageId = value; } }
  99. /// <summary>
  100. /// Video file hash as calculated by one of the implementation functions as seen on http://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes
  101. /// </summary>
  102. public string MovieHash { get { return movieHash; } set { movieHash = value; } }
  103. /// <summary>
  104. /// Size of video file in bytes
  105. /// </summary>
  106. public long MovieByteSize { get { return movieByteSize; } set { movieByteSize = value; } }
  107. /// <summary>
  108. /// ​IMDb ID of movie this video is part of, belongs to.
  109. /// </summary>
  110. public string IMDbID { get { return imdbid; } set { imdbid = value; } }
  111. }
  112. }