aboutsummaryrefslogtreecommitdiff
path: root/OpenSubtitlesHandler/SubtitleTypes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSubtitlesHandler/SubtitleTypes')
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/CheckSubHashResult.cs31
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/SubtitleDownloadResult.cs44
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/SubtitleLanguage.cs39
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchParameters.cs115
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchResult.cs137
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/TryUploadSubtitlesParameters.cs48
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleInfoParameter.cs46
-rw-r--r--OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleParameters.cs53
8 files changed, 513 insertions, 0 deletions
diff --git a/OpenSubtitlesHandler/SubtitleTypes/CheckSubHashResult.cs b/OpenSubtitlesHandler/SubtitleTypes/CheckSubHashResult.cs
new file mode 100644
index 000000000..0e77601ba
--- /dev/null
+++ b/OpenSubtitlesHandler/SubtitleTypes/CheckSubHashResult.cs
@@ -0,0 +1,31 @@
+/* This file is part of OpenSubtitles Handler
+ A library that handle OpenSubtitles.org XML-RPC methods.
+
+ Copyright © Ala Ibrahim Hadid 2013
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+using System;
+
+namespace OpenSubtitlesHandler
+{
+ public struct CheckSubHashResult
+ {
+ private string _hash;
+ private string _id;
+
+ public string Hash { get { return _hash; } set { _hash = value; } }
+ public string SubID { get { return _id; } set { _id = value; } }
+ }
+}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/SubtitleDownloadResult.cs b/OpenSubtitlesHandler/SubtitleTypes/SubtitleDownloadResult.cs
new file mode 100644
index 000000000..35bf796e6
--- /dev/null
+++ b/OpenSubtitlesHandler/SubtitleTypes/SubtitleDownloadResult.cs
@@ -0,0 +1,44 @@
+/* This file is part of OpenSubtitles Handler
+ A library that handle OpenSubtitles.org XML-RPC methods.
+
+ Copyright © Ala Ibrahim Hadid 2013
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+using System;
+
+namespace OpenSubtitlesHandler
+{
+ public struct SubtitleDownloadResult
+ {
+ private string idsubtitlefile;
+ private string data;
+
+ public string IdSubtitleFile
+ { get { return idsubtitlefile; } set { idsubtitlefile = value; } }
+ /// <summary>
+ /// Get or set the data of subtitle file. To decode, decode the string to base64 and then decompress with GZIP.
+ /// </summary>
+ public string Data
+ { get { return data; } set { data = value; } }
+ /// <summary>
+ /// IdSubtitleFile
+ /// </summary>
+ /// <returns></returns>
+ public override string ToString()
+ {
+ return idsubtitlefile.ToString();
+ }
+ }
+}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/SubtitleLanguage.cs b/OpenSubtitlesHandler/SubtitleTypes/SubtitleLanguage.cs
new file mode 100644
index 000000000..511c98670
--- /dev/null
+++ b/OpenSubtitlesHandler/SubtitleTypes/SubtitleLanguage.cs
@@ -0,0 +1,39 @@
+/* This file is part of OpenSubtitles Handler
+ A library that handle OpenSubtitles.org XML-RPC methods.
+
+ Copyright © Ala Ibrahim Hadid 2013
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+namespace OpenSubtitlesHandler
+{
+ public struct SubtitleLanguage
+ {
+ private string _SubLanguageID;
+ private string _LanguageName;
+ private string _ISO639;
+
+ public string SubLanguageID { get { return _SubLanguageID; } set { _SubLanguageID = value; } }
+ public string LanguageName { get { return _LanguageName; } set { _LanguageName = value; } }
+ public string ISO639 { get { return _ISO639; } set { _ISO639 = value; } }
+ /// <summary>
+ /// LanguageName [SubLanguageID]
+ /// </summary>
+ /// <returns>LanguageName [SubLanguageID]</returns>
+ public override string ToString()
+ {
+ return _LanguageName + " [" + _SubLanguageID + "]";
+ }
+ }
+}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchParameters.cs b/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchParameters.cs
new file mode 100644
index 000000000..e11ff1b9a
--- /dev/null
+++ b/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchParameters.cs
@@ -0,0 +1,115 @@
+/* This file is part of OpenSubtitles Handler
+ A library that handle OpenSubtitles.org XML-RPC methods.
+
+ Copyright © Ala Ibrahim Hadid 2013
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+using System;
+
+namespace OpenSubtitlesHandler
+{
+ /// <summary>
+ /// Paramaters for subtitle search call
+ /// </summary>
+ public struct SubtitleSearchParameters
+ {
+ /// <summary>
+ /// Paramaters for subtitle search call
+ /// </summary>
+ /// <param name="subLanguageId">List of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo')</param>
+ /// <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>
+ /// <param name="movieByteSize">Size of video file in bytes </param>
+ public SubtitleSearchParameters(string subLanguageId, string movieHash, long movieByteSize)
+ {
+ this.subLanguageId = subLanguageId;
+ this.movieHash = movieHash;
+ this.movieByteSize = movieByteSize;
+ this.imdbid = "";
+ this._episode = "";
+ this._season = "";
+ this._query = "";
+ }
+
+ public SubtitleSearchParameters(string subLanguageId, string query, string season, string episode)
+ {
+ this.subLanguageId = subLanguageId;
+ this.movieHash = "";
+ this.movieByteSize = 0;
+ this.imdbid = "";
+ this._episode = episode;
+ this._season = season;
+ this._query = query;
+ }
+
+ /// <summary>
+ /// Paramaters for subtitle search call
+ /// </summary>
+ /// <param name="subLanguageId">List of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo')</param>
+ /// <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>
+ /// <param name="movieByteSize">Size of video file in bytes </param>
+ /// <param name="imdbid"> IMDb ID of movie this video is part of, belongs to.</param>
+ public SubtitleSearchParameters(string subLanguageId, string movieHash, long movieByteSize, string imdbid)
+ {
+ this.subLanguageId = subLanguageId;
+ this.movieHash = movieHash;
+ this.movieByteSize = movieByteSize;
+ this.imdbid = imdbid;
+ this._episode = "";
+ this._season = "";
+ this._query = "";
+ }
+
+ private string subLanguageId;
+ private string movieHash;
+ private long movieByteSize;
+ private string imdbid;
+ private string _query;
+ private string _episode;
+
+ public string Episode {
+ get { return _episode; }
+ set { _episode = value; }
+ }
+
+ public string Season {
+ get { return _season; }
+ set { _season = value; }
+ }
+
+ private string _season;
+
+ public string Query {
+ get { return _query; }
+ set { _query = value; }
+ }
+
+ /// <summary>
+ /// List of language ISO639-3 language codes to search for, divided by ',' (e.g. 'cze,eng,slo')
+ /// </summary>
+ public string SubLangaugeID { get { return subLanguageId; } set { subLanguageId = value; } }
+ /// <summary>
+ /// Video file hash as calculated by one of the implementation functions as seen on http://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes
+ /// </summary>
+ public string MovieHash { get { return movieHash; } set { movieHash = value; } }
+ /// <summary>
+ /// Size of video file in bytes
+ /// </summary>
+ public long MovieByteSize { get { return movieByteSize; } set { movieByteSize = value; } }
+ /// <summary>
+ /// ​IMDb ID of movie this video is part of, belongs to.
+ /// </summary>
+ public string IMDbID { get { return imdbid; } set { imdbid = value; } }
+ }
+}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchResult.cs b/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchResult.cs
new file mode 100644
index 000000000..a56a6edab
--- /dev/null
+++ b/OpenSubtitlesHandler/SubtitleTypes/SubtitleSearchResult.cs
@@ -0,0 +1,137 @@
+/* This file is part of OpenSubtitles Handler
+ A library that handle OpenSubtitles.org XML-RPC methods.
+
+ Copyright © Ala Ibrahim Hadid 2013
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+using System;
+
+namespace OpenSubtitlesHandler
+{
+ /// <summary>
+ /// The subtitle search result that comes with server response on SearchSubtitles successed call
+ /// </summary>
+ public struct SubtitleSearchResult
+ {
+ private string _IDSubMovieFile;
+ private string _MovieHash;
+ private string _MovieByteSize;
+ private string _MovieTimeMS;
+ private string _IDSubtitleFile;
+ private string _SubFileName;
+ private string _SubActualCD;
+ private string _SubSize;
+ private string _SubHash;
+ private string _IDSubtitle;
+ private string _UserID;
+ private string _SubLanguageID;
+ private string _SubFormat;
+ private string _SeriesSeason;
+ private string _SeriesEpisode;
+ private string _SubSumCD;
+ private string _SubAuthorComment;
+ private string _SubAddDate;
+ private string _SubBad;
+ private string _SubRating;
+ private string _SubDownloadsCnt;
+ private string _MovieReleaseName;
+ private string _IDMovie;
+ private string _IDMovieImdb;
+ private string _MovieName;
+ private string _MovieNameEng;
+ private string _MovieYear;
+ private string _MovieImdbRating;
+ private string _UserNickName;
+ private string _ISO639;
+ private string _LanguageName;
+ private string _SubDownloadLink;
+ private string _ZipDownloadLink;
+
+ public string IDSubMovieFile
+ { get { return _IDSubMovieFile; } set { _IDSubMovieFile = value; } }
+ public string MovieHash
+ { get { return _MovieHash; } set { _MovieHash = value; } }
+ public string MovieByteSize
+ { get { return _MovieByteSize; } set { _MovieByteSize = value; } }
+ public string MovieTimeMS
+ { get { return _MovieTimeMS; } set { _MovieTimeMS = value; } }
+ public string IDSubtitleFile
+ { get { return _IDSubtitleFile; } set { _IDSubtitleFile = value; } }
+ public string SubFileName
+ { get { return _SubFileName; } set { _SubFileName = value; } }
+ public string SubActualCD
+ { get { return _SubActualCD; } set { _SubActualCD = value; } }
+ public string SubSize
+ { get { return _SubSize; } set { _SubSize = value; } }
+ public string SubHash
+ { get { return _SubHash; } set { _SubHash = value; } }
+ public string IDSubtitle
+ { get { return _IDSubtitle; } set { _IDSubtitle = value; } }
+ public string UserID
+ { get { return _UserID; } set { _UserID = value; } }
+ public string SubLanguageID
+ { get { return _SubLanguageID; } set { _SubLanguageID = value; } }
+ public string SubFormat
+ { get { return _SubFormat; } set { _SubFormat = value; } }
+ public string SubSumCD
+ { get { return _SubSumCD; } set { _SubSumCD = value; } }
+ public string SubAuthorComment
+ { get { return _SubAuthorComment; } set { _SubAuthorComment = value; } }
+ public string SubAddDate
+ { get { return _SubAddDate; } set { _SubAddDate = value; } }
+ public string SubBad
+ { get { return _SubBad; } set { _SubBad = value; } }
+ public string SubRating
+ { get { return _SubRating; } set { _SubRating = value; } }
+ public string SubDownloadsCnt
+ { get { return _SubDownloadsCnt; } set { _SubDownloadsCnt = value; } }
+ public string MovieReleaseName
+ { get { return _MovieReleaseName; } set { _MovieReleaseName = value; } }
+ public string IDMovie
+ { get { return _IDMovie; } set { _IDMovie = value; } }
+ public string IDMovieImdb
+ { get { return _IDMovieImdb; } set { _IDMovieImdb = value; } }
+ public string MovieName
+ { get { return _MovieName; } set { _MovieName = value; } }
+ public string MovieNameEng
+ { get { return _MovieNameEng; } set { _MovieNameEng = value; } }
+ public string MovieYear
+ { get { return _MovieYear; } set { _MovieYear = value; } }
+ public string MovieImdbRating
+ { get { return _MovieImdbRating; } set { _MovieImdbRating = value; } }
+ public string UserNickName
+ { get { return _UserNickName; } set { _UserNickName = value; } }
+ public string ISO639
+ { get { return _ISO639; } set { _ISO639 = value; } }
+ public string LanguageName
+ { get { return _LanguageName; } set { _LanguageName = value; } }
+ public string SubDownloadLink
+ { get { return _SubDownloadLink; } set { _SubDownloadLink = value; } }
+ public string ZipDownloadLink
+ { get { return _ZipDownloadLink; } set { _ZipDownloadLink = value; } }
+ public string SeriesSeason
+ { get { return _SeriesSeason; } set { _SeriesSeason = value; } }
+ public string SeriesEpisode
+ { get { return _SeriesEpisode; } set { _SeriesEpisode = value; } }
+ /// <summary>
+ /// SubFileName + " (" + SubFormat + ")"
+ /// </summary>
+ /// <returns></returns>
+ public override string ToString()
+ {
+ return _SubFileName + " (" + _SubFormat + ")";
+ }
+ }
+}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/TryUploadSubtitlesParameters.cs b/OpenSubtitlesHandler/SubtitleTypes/TryUploadSubtitlesParameters.cs
new file mode 100644
index 000000000..a95d151eb
--- /dev/null
+++ b/OpenSubtitlesHandler/SubtitleTypes/TryUploadSubtitlesParameters.cs
@@ -0,0 +1,48 @@
+/* This file is part of OpenSubtitles Handler
+ A library that handle OpenSubtitles.org XML-RPC methods.
+
+ Copyright © Ala Ibrahim Hadid 2013
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+using System;
+
+namespace OpenSubtitlesHandler
+{
+ public class TryUploadSubtitlesParameters
+ {
+ private string _subhash = "";
+ private string _subfilename = "";
+ private string _moviehash = "";
+ private string _moviebytesize = "";
+ private int _movietimems = 0;
+ private int _movieframes = 0;
+ private double _moviefps = 0;
+ private string _moviefilename = "";
+
+ public string subhash { get { return _subhash; } set { _subhash = value; } }
+ public string subfilename { get { return _subfilename; } set { _subfilename = value; } }
+ public string moviehash { get { return _moviehash; } set { _moviehash = value; } }
+ public string moviebytesize { get { return _moviebytesize; } set { _moviebytesize = value; } }
+ public int movietimems { get { return _movietimems; } set { _movietimems = value; } }
+ public int movieframes { get { return _movieframes; } set { _movieframes = value; } }
+ public double moviefps { get { return _moviefps; } set { _moviefps = value; } }
+ public string moviefilename { get { return _moviefilename; } set { _moviefilename = value; } }
+
+ public override string ToString()
+ {
+ return _subfilename + " (" + _subhash + ")";
+ }
+ }
+}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleInfoParameter.cs b/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleInfoParameter.cs
new file mode 100644
index 000000000..8e147878b
--- /dev/null
+++ b/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleInfoParameter.cs
@@ -0,0 +1,46 @@
+/* This file is part of OpenSubtitles Handler
+ A library that handle OpenSubtitles.org XML-RPC methods.
+
+ Copyright © Ala Ibrahim Hadid 2013
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+using System;
+using System.Collections.Generic;
+
+namespace OpenSubtitlesHandler
+{
+ public class UploadSubtitleInfoParameters
+ {
+ private string _idmovieimdb;
+ private string _moviereleasename;
+ private string _movieaka;
+ private string _sublanguageid;
+ private string _subauthorcomment;
+ private bool _hearingimpaired;
+ private bool _highdefinition;
+ private bool _automatictranslation;
+ private List<UploadSubtitleParameters> cds;
+
+ public string idmovieimdb { get { return _idmovieimdb; } set { _idmovieimdb = value; } }
+ public string moviereleasename { get { return _moviereleasename; } set { _moviereleasename = value; } }
+ public string movieaka { get { return _movieaka; } set { _movieaka = value; } }
+ public string sublanguageid { get { return _sublanguageid; } set { _sublanguageid = value; } }
+ public string subauthorcomment { get { return _subauthorcomment; } set { _subauthorcomment = value; } }
+ public bool hearingimpaired { get { return _hearingimpaired; } set { _hearingimpaired = value; } }
+ public bool highdefinition { get { return _highdefinition; } set { _highdefinition = value; } }
+ public bool automatictranslation { get { return _automatictranslation; } set { _automatictranslation = value; } }
+ public List<UploadSubtitleParameters> CDS { get { return cds; } set { cds = value; } }
+ }
+}
diff --git a/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleParameters.cs b/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleParameters.cs
new file mode 100644
index 000000000..90a273959
--- /dev/null
+++ b/OpenSubtitlesHandler/SubtitleTypes/UploadSubtitleParameters.cs
@@ -0,0 +1,53 @@
+/* This file is part of OpenSubtitles Handler
+ A library that handle OpenSubtitles.org XML-RPC methods.
+
+ Copyright © Ala Ibrahim Hadid 2013
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+using System;
+
+namespace OpenSubtitlesHandler
+{
+ public struct UploadSubtitleParameters
+ {
+ private string _subhash;
+ private string _subfilename;
+ private string _moviehash;
+ private double _moviebytesize;
+ private int _movietimems;
+ private int _movieframes;
+ private double _moviefps;
+ private string _moviefilename;
+ private string _subcontent;
+
+ public string subhash { get { return _subhash; } set { _subhash = value; } }
+ public string subfilename { get { return _subfilename; } set { _subfilename = value; } }
+ public string moviehash { get { return _moviehash; } set { _moviehash = value; } }
+ public double moviebytesize { get { return _moviebytesize; } set { _moviebytesize = value; } }
+ public int movietimems { get { return _movietimems; } set { _movietimems = value; } }
+ public int movieframes { get { return _movieframes; } set { _movieframes = value; } }
+ public double moviefps { get { return _moviefps; } set { _moviefps = value; } }
+ public string moviefilename { get { return _moviefilename; } set { _moviefilename = value; } }
+ /// <summary>
+ /// Sub content. Note: this value must be the subtitle file gziped and then base64 decoded.
+ /// </summary>
+ public string subcontent { get { return _subcontent; } set { _subcontent = value; } }
+
+ public override string ToString()
+ {
+ return _subfilename + " (" + _subhash + ")";
+ }
+ }
+}