1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-22 21:22:40 +00:00

Simplify tag summary

This commit is contained in:
J. King 2019-03-07 08:20:09 -05:00
parent ff0c9a3a55
commit e6f70527cf
2 changed files with 8 additions and 11 deletions

View file

@ -2002,14 +2002,11 @@ class Database {
}
return $this->db->prepare(
"SELECT
arsse_tags.id as tag_id,
arsse_tags.name as tag_name,
arsse_subscriptions.id as subscription_id,
coalesce(arsse_subscriptions.title, arsse_feeds.title) as subscription_name
arsse_tags.id as id,
arsse_tags.name as name,
arsse_tag_members.subscription as subscription
FROM arsse_tag_members
join arsse_tags on arsse_tags.id = arsse_tag_members.tag
join arsse_subscriptions on arsse_subscriptions.id = arsse_tag_members.subscription
join arsse_feeds on arsse_feeds.id = arsse_subscriptions.feed
WHERE arsse_tags.owner = ? and assigned = 1",
"str"
)->run($user);

View file

@ -378,11 +378,11 @@ trait SeriesTag {
public function testSummarizeTags() {
$exp = [
['tag_id' => 1, 'tag_name' => "Interesting", 'subscription_id' => 1, 'subscription_name' => "Lord of Carrots"],
['tag_id' => 1, 'tag_name' => "Interesting", 'subscription_id' => 5, 'subscription_name' => "Feed Title"],
['tag_id' => 2, 'tag_name' => "Fascinating", 'subscription_id' => 1, 'subscription_name' => "Lord of Carrots"],
['tag_id' => 2, 'tag_name' => "Fascinating", 'subscription_id' => 3, 'subscription_name' => "Subscription Title"],
['tag_id' => 2, 'tag_name' => "Fascinating", 'subscription_id' => 5, 'subscription_name' => "Feed Title"],
['id' => 1, 'name' => "Interesting", 'subscription' => 1],
['id' => 1, 'name' => "Interesting", 'subscription' => 5],
['id' => 2, 'name' => "Fascinating", 'subscription' => 1],
['id' => 2, 'name' => "Fascinating", 'subscription' => 3],
['id' => 2, 'name' => "Fascinating", 'subscription' => 5],
];
$this->assertResult($exp, Arsse::$db->tagSummarize("john.doe@example.com"));
}