mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
add wanted events support #27
This commit is contained in:
parent
5f4a14ebe2
commit
24c58d4301
20 changed files with 249 additions and 1 deletions
|
|
@ -61,6 +61,8 @@ class ActivityService
|
|||
|
||||
Activity::EVENT_TORRENT_DOWNLOAD_FILE_ADD,
|
||||
Activity::EVENT_TORRENT_DOWNLOAD_MAGNET_ADD,
|
||||
|
||||
Activity::EVENT_TORRENT_WANTED_ADD,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -365,6 +367,18 @@ class ActivityService
|
|||
] = $code;
|
||||
|
||||
break;
|
||||
|
||||
case Activity::EVENT_TORRENT_WANTED_ADD:
|
||||
|
||||
$events
|
||||
[
|
||||
$this->translatorInterface->trans('Torrents')
|
||||
]
|
||||
[
|
||||
$this->translatorInterface->trans('Wanted')
|
||||
] = $code;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -847,6 +861,37 @@ class ActivityService
|
|||
return $activity;
|
||||
}
|
||||
|
||||
|
||||
public function addEventTorrentWantedAdd(
|
||||
int $userId,
|
||||
int $added,
|
||||
int $torrentId
|
||||
): ?Activity
|
||||
{
|
||||
$activity = new Activity();
|
||||
|
||||
$activity->setEvent(
|
||||
Activity::EVENT_TORRENT_WANTED_ADD
|
||||
);
|
||||
|
||||
$activity->setUserId(
|
||||
$userId
|
||||
);
|
||||
|
||||
$activity->setAdded(
|
||||
$added
|
||||
);
|
||||
|
||||
$activity->setTorrentId(
|
||||
$torrentId
|
||||
);
|
||||
|
||||
$this->entityManagerInterface->persist($activity);
|
||||
$this->entityManagerInterface->flush();
|
||||
|
||||
return $activity;
|
||||
}
|
||||
|
||||
/// Torrent Download
|
||||
public function addEventTorrentDownloadFileAdd(
|
||||
int $userId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue