view include/core/torrent.h @ 337:a7d4e5107531

dep/animone: REFACTOR ALL THE THINGS 1: animone now has its own syntax divergent from anisthesia, making different platforms actually have their own sections 2: process names in animone are now called `comm' (this will probably break things). this is what its called in bsd/linux so I'm just going to use it everywhere 3: the X11 code now checks for the existence of a UTF-8 window title and passes it if available 4: ANYTHING THATS NOT LINUX IS 100% UNTESTED AND CAN AND WILL BREAK! I still actually need to test the bsd code. to be honest I'm probably going to move all of the bsds into separate files because they're all essentially different operating systems at this point
author Paper <paper@paper.us.eu.org>
date Wed, 19 Jun 2024 12:51:15 -0400
parents b1f625b0227c
children
line wrap: on
line source

#ifndef MINORI_CORE_TORRENT_H_
#define MINORI_CORE_TORRENT_H_

#include <QDateTime>
#include <string>

/* this is really just a fancy struct...
 *
 * this will be moved into its own namespace if
 * it's deemed necessary
 */
class Torrent {
public:
	std::string GetTitle() const { return _title; };
	std::string GetCategory() const { return _category; };
	std::string GetEpisode() const { return _episode; };
	std::string GetGroup() const { return _group; };
	size_t GetSize() const { return _size; };
	std::string GetResolution() const { return _resolution; };
	int GetSeeders() const { return _seeders; };
	int GetLeechers() const { return _leechers; };
	int GetDownloads() const { return _downloads; };
	std::string GetDescription() const { return _description; };
	std::string GetFilename() const { return _filename; };
	std::string GetLink() const { return _link; };
	std::string GetGuid() const { return _guid; };
	QDateTime GetDate() const { return _date; };

	void SetTitle(const std::string& title) { _title = title; };
	void SetCategory(const std::string& category) { _category = category; };
	void SetEpisode(const std::string& episode) { _episode = episode; };
	void SetGroup(const std::string& group) { _group = group; };
	void SetSize(const size_t size) { _size = size; };
	void SetResolution(const std::string& resolution) { _resolution = resolution; };
	void SetSeeders(const int seeders) { _seeders = seeders; };
	void SetLeechers(const int leechers) { _leechers = leechers; };
	void SetDownloads(const int downloads) { _downloads = downloads; };
	void SetDescription(const std::string& description) { _description = description; };
	void SetFilename(const std::string& filename) { _filename = filename; };
	void SetLink(const std::string& link) { _link = link; };
	void SetGuid(const std::string& guid) { _guid = guid; };
	void SetDate(const QDateTime& date) { _date = date; };

private:
	std::string _title;
	std::string _category;
	std::string _episode;
	std::string _group;
	size_t _size = 0;
	std::string _resolution; /* technically should be an int,
	                            but std::string is more useful */
	int _seeders = 0;
	int _leechers = 0;
	int _downloads = 0;
	std::string _description;
	std::string _filename;
	std::string _link;
	std::string _guid;
	QDateTime _date;
};

#endif // MINORI_CORE_TORRENT_H_