Resolve channels #150
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
Osprey
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
resilience
Tom's Wishlist
type: bug
type: discussion
type: error handling
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
LBRYCommunity/spee.ch!150
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "resolve-channels"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
added support for channel resolutions
reorganized router functions
still to do: (will be a separate pr): add channel information to the asset's info page
Some clean-up would be good here.
@ -3,2 +3,3 @@const logger = require('winston');const { getTopFreeClaim, getFullClaimIdFromShortId, resolveAgainstClaimTable } = require('../helpers/serveHelpers.js');const { resolveAgainstClaimTable, serveFile, showFile, showFileLite, getShortClaimIdFromLongClaimId, getClaimIdByLongChannelId, getAllChannelClaims, getLongChannelId, getShortChannelIdFromLongChannelId, getLongClaimId } = require('../helpers/serveHelpers.js');const { postToStats, sendGoogleAnalytics } = require('../controllers/statsController.js');This looks like it could use better organization. I'd be inclined to put a lot of these inside of the
modalfolder, but I'd suggest looking at what other conventions are used in this framework before doing that.This is shared across all 3 cases and could be pulled above/out.
@ -159,0 +160,4 @@logger.debug('retrieving most recent claims');return new Promise((resolve, reject) => {// get the raw requests datadb.sequelize.query(`SELECT * FROM File WHERE nsfw != 1 AND trendingEligible = 1 ORDER BY createdAt DESC LIMIT 25;`, { type: db.sequelize.QueryTypes.SELECT })Try to avoid SQL in your controllers and keep it located in the modal layer. This helps facilitates future modal refactoring/redesign and keeps controllers simpler (controllers are typically then thinnest of the 3 MVC layers).
@ -0,0 +1,8 @@module.exports = {I'd be more inclined to keep these where they were, or to put them on the object/class they relate to, then to create a single constants file like this.
@ -21,6 +21,19 @@ module.exports = (app) => {errorHandlers.handleRequestError(error, res);The old URL ought to be 301 redirect to the new one.
Conventionally, the extension would not include the period (e.g. "gifv" not ".gifv").
updated in new branch
lbryio/spee.ch@69741dfc1dlbryio/spee.ch@c901ced94c@ -159,0 +160,4 @@logger.debug('retrieving most recent claims');return new Promise((resolve, reject) => {// get the raw requests datadb.sequelize.query(`SELECT * FROM File WHERE nsfw != 1 AND trendingEligible = 1 ORDER BY createdAt DESC LIMIT 25;`, { type: db.sequelize.QueryTypes.SELECT })moved to model
lbryio/spee.ch@4d94acee77@ -21,6 +21,19 @@ module.exports = (app) => {errorHandlers.handleRequestError(error, res);added redirect
lbryio/spee.ch@7a81d53c35@ -0,0 +1,8 @@module.exports = {moved to their individual modules
lbryio/spee.ch@f0435be0b2@ -3,2 +3,3 @@const logger = require('winston');const { getTopFreeClaim, getFullClaimIdFromShortId, resolveAgainstClaimTable } = require('../helpers/serveHelpers.js');const { resolveAgainstClaimTable, serveFile, showFile, showFileLite, getShortClaimIdFromLongClaimId, getClaimIdByLongChannelId, getAllChannelClaims, getLongChannelId, getShortChannelIdFromLongChannelId, getLongClaimId } = require('../helpers/serveHelpers.js');const { postToStats, sendGoogleAnalytics } = require('../controllers/statsController.js');I get a little confused sometimes on the line between controller and model responsibilities. But, yes, after looking at it and re-reading some MVC notes, I think that all the database related functions should go in the model. I rearranged as such.
lbryio/spee.ch@af046e9d36