Skip to content

Commit

Permalink
Merge pull request #729 from podverse/develop
Browse files Browse the repository at this point in the history
Release v4.16.2
  • Loading branch information
mitchdowney authored Apr 4, 2024
2 parents 75bc222 + 3948a17 commit 91f5770
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "podverse-api",
"version": "4.16.1",
"version": "4.16.2",
"description": "Data API, database migration scripts, and backend services for all Podverse models.",
"contributors": [
"Mitch Downey"
Expand Down
32 changes: 16 additions & 16 deletions src/services/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,16 @@ const generateResetToZeroQueryString = (finalPagePath: string, timeRange, id: st
queryString = `
UPDATE "podcasts"
SET "${TimeRanges[timeRange]}"=0
WHERE id='${id}'
WHERE id = '${id}'
AND "hasVideo" IS FALSE
AND "medium" = 'podcast';
`
} else if (finalPagePath === PagePaths.episodes) {
queryString = `
UPDATE "episodes" e
SET "${TimeRanges[timeRange]}" = 0
WHERE e.id = ${id}
AND e."podcastId"
WHERE id = '${id}'
AND "podcastId"
IN (
SELECT p.id
FROM podcasts p
Expand All @@ -211,24 +211,24 @@ const generateResetToZeroQueryString = (finalPagePath: string, timeRange, id: st
`
} else if (finalPagePath === PagePaths.clips) {
queryString = `
UPDATE "mediaRefs" m
SET m."${TimeRanges[timeRange]}"=0
WHERE m.id='${id}';
UPDATE "mediaRefs"
SET "${TimeRanges[timeRange]}"=0
WHERE id = '${id}';
`
} else if (finalPagePath === PagePaths.albums) {
queryString = `
UPDATE "podcasts"
SET "${TimeRanges[timeRange]}"=0
WHERE id='${id}'
WHERE id = '${id}'
AND "hasVideo" IS FALSE
AND "medium" = 'music';
`
} else if (finalPagePath === PagePaths.tracks) {
queryString = `
UPDATE "episodes" AS e
SET "${TimeRanges[timeRange]}" = 0
WHERE e.id = ${id}
AND e."podcastId"
WHERE id = ${id}
AND "podcastId"
IN (
SELECT p.id
FROM podcasts p
Expand All @@ -241,15 +241,15 @@ const generateResetToZeroQueryString = (finalPagePath: string, timeRange, id: st
queryString = `
UPDATE "podcasts"
SET "${TimeRanges[timeRange]}"=0
WHERE id='${id}'
WHERE id = '${id}'
AND "hasVideo" IS TRUE;
`
} else if (finalPagePath === PagePaths.videos) {
queryString = `
UPDATE "episodes" AS e
SET "${TimeRanges[timeRange]}" = 0
WHERE e.id = ${id}
AND e."podcastId"
WHERE id = ${id}
AND "podcastId"
IN (
SELECT p.id
FROM podcasts p
Expand All @@ -271,7 +271,7 @@ const generateSetNewCountQuery = (finalPagePath: string, timeRange, id: string,
queryString = `
UPDATE "podcasts"
SET "${TimeRanges[timeRange]}"=${sum_daily_nb_uniq_visitors}
WHERE id='${id}'
WHERE id = '${id}'
AND "hasVideo" IS FALSE
AND "medium" = 'podcast';
`
Expand All @@ -293,13 +293,13 @@ const generateSetNewCountQuery = (finalPagePath: string, timeRange, id: string,
queryString = `
UPDATE "mediaRefs"
SET "${TimeRanges[timeRange]}"=${sum_daily_nb_uniq_visitors}
WHERE id='${id}';
WHERE id = '${id}';
`
} else if (finalPagePath === PagePaths.albums) {
queryString = `
UPDATE "podcasts"
SET "${TimeRanges[timeRange]}"=${sum_daily_nb_uniq_visitors}
WHERE id='${id}'
WHERE id = '${id}'
AND "hasVideo" IS FALSE
AND "medium" = 'music';
`
Expand All @@ -321,7 +321,7 @@ const generateSetNewCountQuery = (finalPagePath: string, timeRange, id: string,
queryString = `
UPDATE "podcasts"
SET "${TimeRanges[timeRange]}"=${sum_daily_nb_uniq_visitors}
WHERE id='${id}'
WHERE id = '${id}'
AND "hasVideo" IS TRUE;
`
} else if (finalPagePath === PagePaths.videos) {
Expand Down

0 comments on commit 91f5770

Please sign in to comment.