annotate include/core/torrent.h @ 118:39521c47c7a3

*: another huge megacommit, SORRY The torrents page works a lot better now Added the edit option to the anime list right click menu Vectorized currently playing files Available player and extensions are now loaded at runtime from files in (dotpath)/players.json and (dotpath)/extensions.json These paths are not permanent and will likely be moved to (dotpath)/recognition ... ... ...
author Paper <mrpapersonic@gmail.com>
date Tue, 07 Nov 2023 23:40:54 -0500
parents ab191e28e69d
children 4d461ef7d424
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
114
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 #ifndef __core__torrent_h
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2 #define __core__torrent_h
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4 #include <string>
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
5 #include <QDateTime>
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 114
diff changeset
7 /* this is really just a fancy struct...
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 114
diff changeset
8
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 114
diff changeset
9 this will be moved into its own namespace if
114
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 it's deemed necessary */
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11 class Torrent {
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12 public:
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
13 std::string GetTitle() const { return _title; };
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 114
diff changeset
14 std::string GetCategory() const { return _category; };
114
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
15 std::string GetEpisode() const { return _episode; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 std::string GetGroup() const { return _group; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
17 size_t GetSize() const { return _size; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18 std::string GetResolution() const { return _resolution; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19 int GetSeeders() const { return _seeders; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20 int GetLeechers() const { return _leechers; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 int GetDownloaders() const { return _downloaders; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 std::string GetDescription() const { return _description; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 std::string GetFilename() const { return _filename; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24 std::string GetLink() const { return _link; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 std::string GetGuid() const { return _guid; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
26 QDateTime GetDate() const { return _date; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
27
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
28 void SetTitle(const std::string& title) { _title = title; };
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 114
diff changeset
29 void SetCategory(const std::string& category) { _category = category; };
114
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
30 void SetEpisode(const std::string& episode) { _episode = episode; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
31 void SetGroup(const std::string& group) { _group = group; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
32 void SetSize(const size_t size) { _size = size; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
33 void SetResolution(const std::string& resolution) { _resolution = resolution; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
34 void SetSeeders(const int seeders) { _seeders = seeders; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
35 void SetLeechers(const int leechers) { _leechers = leechers; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
36 void SetDownloaders(const int downloaders) { _downloaders = downloaders; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
37 void SetDescription(const std::string& description) { _description = description; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38 void SetFilename(const std::string& filename) { _filename = filename; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39 void SetLink(const std::string& link) { _link = link; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
40 void SetGuid(const std::string& guid) { _guid = guid; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
41 void SetDate(const QDateTime& date) { _date = date; };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
42
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
43 private:
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
44 std::string _title;
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 114
diff changeset
45 std::string _category;
114
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
46 std::string _episode;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
47 std::string _group;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48 size_t _size = 0;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49 std::string _resolution; /* technically should be an int,
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50 but std::string is more useful */
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51 int _seeders = 0;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
52 int _leechers = 0;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
53 int _downloaders = 0;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54 std::string _description;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
55 std::string _filename;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
56 std::string _link;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
57 std::string _guid;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
58 QDateTime _date;
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
59 };
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
60
ab191e28e69d *: add initial torrent stuff
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
61 #endif // __core__torrent_h