Create scripts/store/getters
This commit is contained in:
		
							
								
								
									
										12
									
								
								scripts/store/getters/group_title.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								scripts/store/getters/group_title.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | |||||||
|  | module.exports = function () { | ||||||
|  |   if (this.group_title) return this.group_title | ||||||
|  |  | ||||||
|  |   if (Array.isArray(this.categories)) { | ||||||
|  |     return this.categories | ||||||
|  |       .map(i => i.name) | ||||||
|  |       .sort() | ||||||
|  |       .join(';') | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   return '' | ||||||
|  | } | ||||||
							
								
								
									
										7
									
								
								scripts/store/getters/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								scripts/store/getters/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | exports.group_title = require('./group_title') | ||||||
|  | exports.title = require('./title') | ||||||
|  | exports.tvg_country = require('./tvg_country') | ||||||
|  | exports.tvg_id = require('./tvg_id') | ||||||
|  | exports.tvg_language = require('./tvg_language') | ||||||
|  | exports.tvg_logo = require('./tvg_logo') | ||||||
|  | exports.tvg_url = require('./tvg_url') | ||||||
							
								
								
									
										13
									
								
								scripts/store/getters/title.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								scripts/store/getters/title.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | module.exports = function () { | ||||||
|  |   let title = this.name | ||||||
|  |  | ||||||
|  |   if (this.resolution.height) { | ||||||
|  |     title += ` (${this.resolution.height}p)` | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   if (this.status.label) { | ||||||
|  |     title += ` [${this.status.label}]` | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   return title | ||||||
|  | } | ||||||
							
								
								
									
										5
									
								
								scripts/store/getters/tvg_country.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								scripts/store/getters/tvg_country.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | |||||||
|  | module.exports = function () { | ||||||
|  |   if (this.tvg_country) return this.tvg_country | ||||||
|  |  | ||||||
|  |   return Array.isArray(this.countries) ? this.countries.map(i => i.code).join(';') : '' | ||||||
|  | } | ||||||
							
								
								
									
										3
									
								
								scripts/store/getters/tvg_id.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								scripts/store/getters/tvg_id.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | module.exports = function () { | ||||||
|  |   return this.id || '' | ||||||
|  | } | ||||||
							
								
								
									
										3
									
								
								scripts/store/getters/tvg_language.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								scripts/store/getters/tvg_language.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | module.exports = function () { | ||||||
|  |   return Array.isArray(this.languages) ? this.languages.map(i => i.name).join(';') : '' | ||||||
|  | } | ||||||
							
								
								
									
										3
									
								
								scripts/store/getters/tvg_logo.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								scripts/store/getters/tvg_logo.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | module.exports = function () { | ||||||
|  |   return this.logo || '' | ||||||
|  | } | ||||||
							
								
								
									
										3
									
								
								scripts/store/getters/tvg_url.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								scripts/store/getters/tvg_url.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | module.exports = function () { | ||||||
|  |   return this.guides.length ? this.guides[0] : '' | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user