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:
parent
ff0c9a3a55
commit
e6f70527cf
2 changed files with 8 additions and 11 deletions
|
@ -2002,14 +2002,11 @@ class Database {
|
||||||
}
|
}
|
||||||
return $this->db->prepare(
|
return $this->db->prepare(
|
||||||
"SELECT
|
"SELECT
|
||||||
arsse_tags.id as tag_id,
|
arsse_tags.id as id,
|
||||||
arsse_tags.name as tag_name,
|
arsse_tags.name as name,
|
||||||
arsse_subscriptions.id as subscription_id,
|
arsse_tag_members.subscription as subscription
|
||||||
coalesce(arsse_subscriptions.title, arsse_feeds.title) as subscription_name
|
|
||||||
FROM arsse_tag_members
|
FROM arsse_tag_members
|
||||||
join arsse_tags on arsse_tags.id = arsse_tag_members.tag
|
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",
|
WHERE arsse_tags.owner = ? and assigned = 1",
|
||||||
"str"
|
"str"
|
||||||
)->run($user);
|
)->run($user);
|
||||||
|
|
|
@ -378,11 +378,11 @@ trait SeriesTag {
|
||||||
|
|
||||||
public function testSummarizeTags() {
|
public function testSummarizeTags() {
|
||||||
$exp = [
|
$exp = [
|
||||||
['tag_id' => 1, 'tag_name' => "Interesting", 'subscription_id' => 1, 'subscription_name' => "Lord of Carrots"],
|
['id' => 1, 'name' => "Interesting", 'subscription' => 1],
|
||||||
['tag_id' => 1, 'tag_name' => "Interesting", 'subscription_id' => 5, 'subscription_name' => "Feed Title"],
|
['id' => 1, 'name' => "Interesting", 'subscription' => 5],
|
||||||
['tag_id' => 2, 'tag_name' => "Fascinating", 'subscription_id' => 1, 'subscription_name' => "Lord of Carrots"],
|
['id' => 2, 'name' => "Fascinating", 'subscription' => 1],
|
||||||
['tag_id' => 2, 'tag_name' => "Fascinating", 'subscription_id' => 3, 'subscription_name' => "Subscription Title"],
|
['id' => 2, 'name' => "Fascinating", 'subscription' => 3],
|
||||||
['tag_id' => 2, 'tag_name' => "Fascinating", 'subscription_id' => 5, 'subscription_name' => "Feed Title"],
|
['id' => 2, 'name' => "Fascinating", 'subscription' => 5],
|
||||||
];
|
];
|
||||||
$this->assertResult($exp, Arsse::$db->tagSummarize("john.doe@example.com"));
|
$this->assertResult($exp, Arsse::$db->tagSummarize("john.doe@example.com"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue