~cadence/cloudtube

cebc4331bcd72e79d795c8be46837d53168c2157 — Cadence Ember 6 months ago db7ccab
Correctly set filter referrer everywhere
4 files changed, 5 insertions(+), 5 deletions(-)

M api/channels.js
M api/search.js
M api/video.js
M pug/includes/video-list-item.pug
M api/channels.js => api/channels.js +2 -2
@@ 6,7 6,7 @@ const converters = require("../utils/converters")

module.exports = [
	{
		route: `/channel/(${constants.regex.ucid})`, methods: ["GET"], code: async ({req, fill}) => {
		route: `/channel/(${constants.regex.ucid})`, methods: ["GET"], code: async ({req, fill, url}) => {
			const id = fill[0]
			const user = getUser(req)
			const settings = user.getSettingsOrDefaults()


@@ 24,7 24,7 @@ module.exports = [
					video.watched = watchedVideos.includes(video.videoId)
				})
			}
			return render(200, "pug/channel.pug", {data, subscribed, instanceOrigin})
			return render(200, "pug/channel.pug", {url, data, subscribed, instanceOrigin})
		}
	}
]

M api/search.js => api/search.js +1 -1
@@ 26,7 26,7 @@ module.exports = [
			const filters = user.getFilters()
			results = converters.applyVideoFilters(results, filters).videos

			return render(200, "pug/search.pug", {query, results, instanceOrigin})
			return render(200, "pug/search.pug", {url, query, results, instanceOrigin})
		}
	}
]

M api/video.js => api/video.js +1 -1
@@ 175,7 175,7 @@ module.exports = [
				video.descriptionHtml = converters.rewriteVideoDescription(video.descriptionHtml, id)

				return render(200, "pug/video.pug", {
					video, formats, subscribed, instanceOrigin, mediaFragment, autoplay, continuous,
					url, video, formats, subscribed, instanceOrigin, mediaFragment, autoplay, continuous,
					sessionWatched, sessionWatchedNext
				})


M pug/includes/video-list-item.pug => pug/includes/video-list-item.pug +1 -1
@@ 13,7 13,7 @@ mixin video_list_item(className, video, instanceOrigin, options = {})
        .thumbnail__options-container
          .thumbnail__options-list
            - const paramsBase = {}
            - if (url) paramsBase.referrer = url.pathname + (url.search && "?" + url.search)
            - if (url) paramsBase.referrer = url.pathname + url.search
            a(href=`/filters?${new URLSearchParams({"channel-id": video.authorId, label: video.author, ...paramsBase})}`).menu-look Hide this channel
            a(href=`/filters?${new URLSearchParams({title: video.title, ...paramsBase})}`).menu-look Hide by title
            a(href="/filters").menu-look Edit all filters