SubtitleSearchParameters.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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, string season, string episode)
  40. {
  41. this.subLanguageId = subLanguageId;
  42. this.movieHash = "";
  43. this.movieByteSize = 0;
  44. this.imdbid = "";
  45. this._episode = episode;
  46. this._season = season;
  47. this._query = query;
  48. }
  49. /// <summary>
  50. /// Paramaters for subtitle search call
  51. /// </summary>
  52. /// <param name="subLanguageId">List of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo')</param>
  53. /// <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>
  54. /// <param name="movieByteSize">Size of video file in bytes </param>
  55. /// <param name="imdbid"> IMDb ID of movie this video is part of, belongs to.</param>
  56. public SubtitleSearchParameters(string subLanguageId, string movieHash, long movieByteSize, string imdbid)
  57. {
  58. this.subLanguageId = subLanguageId;
  59. this.movieHash = movieHash;
  60. this.movieByteSize = movieByteSize;
  61. this.imdbid = imdbid;
  62. this._episode = "";
  63. this._season = "";
  64. this._query = "";
  65. }
  66. private string subLanguageId;
  67. private string movieHash;
  68. private long movieByteSize;
  69. private string imdbid;
  70. private string _query;
  71. private string _episode;
  72. public string Episode {
  73. get { return _episode; }
  74. set { _episode = value; }
  75. }
  76. public string Season {
  77. get { return _season; }
  78. set { _season = value; }
  79. }
  80. private string _season;
  81. public string Query {
  82. get { return _query; }
  83. set { _query = value; }
  84. }
  85. /// <summary>
  86. /// List of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo')
  87. /// </summary>
  88. public string SubLangaugeID { get { return subLanguageId; } set { subLanguageId = value; } }
  89. /// <summary>
  90. /// Video file hash as calculated by one of the implementation functions as seen on http://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes
  91. /// </summary>
  92. public string MovieHash { get { return movieHash; } set { movieHash = value; } }
  93. /// <summary>
  94. /// Size of video file in bytes
  95. /// </summary>
  96. public long MovieByteSize { get { return movieByteSize; } set { movieByteSize = value; } }
  97. /// <summary>
  98. /// ​IMDb ID of movie this video is part of, belongs to.
  99. /// </summary>
  100. public string IMDbID { get { return imdbid; } set { imdbid = value; } }
  101. }
  102. }