|
1 | 1 | use serde::{Deserialize, Serialize};
|
2 | 2 |
|
| 3 | +use super::category::Category; |
3 | 4 | use super::torrent::TorrentId;
|
4 |
| -use crate::databases::database::Category; |
| 5 | +use crate::databases::database::Category as DatabaseCategory; |
5 | 6 | use crate::models::torrent::TorrentListing;
|
6 | 7 | use crate::models::torrent_file::TorrentFile;
|
7 | 8 | use crate::models::torrent_tag::TorrentTag;
|
@@ -70,14 +71,14 @@ pub struct TorrentResponse {
|
70 | 71 |
|
71 | 72 | impl TorrentResponse {
|
72 | 73 | #[must_use]
|
73 |
| - pub fn from_listing(torrent_listing: TorrentListing, category: Option<Category>) -> TorrentResponse { |
| 74 | + pub fn from_listing(torrent_listing: TorrentListing, category: Option<DatabaseCategory>) -> TorrentResponse { |
74 | 75 | TorrentResponse {
|
75 | 76 | torrent_id: torrent_listing.torrent_id,
|
76 | 77 | uploader: torrent_listing.uploader,
|
77 | 78 | info_hash: torrent_listing.info_hash,
|
78 | 79 | title: torrent_listing.title,
|
79 | 80 | description: torrent_listing.description,
|
80 |
| - category, |
| 81 | + category: category.map(std::convert::Into::into), |
81 | 82 | upload_date: torrent_listing.date_uploaded,
|
82 | 83 | file_size: torrent_listing.file_size,
|
83 | 84 | seeders: torrent_listing.seeders,
|
|
0 commit comments