dizquetv/web/services/pseudotv.js
Dan Ferguson 681ab5f6c6 alpha v4
2020-04-23 16:11:40 -04:00

107 lines
4.1 KiB
JavaScript

module.exports = function ($http) {
return {
getPlexServers: () => {
return $http.get('/api/plex-servers').then((d) => { return d.data })
},
addPlexServer: (plexServer) => {
return $http({
method: 'POST',
url: '/api/plex-servers',
data: plexServer,
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
removePlexServer: (serverId) => {
return $http({
method: 'DELETE',
url: '/api/plex-servers',
data: { _id: serverId },
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
getFfmpegSettings: () => {
return $http.get('/api/ffmpeg-settings').then((d) => { return d.data })
},
updateFfmpegSettings: (config) => {
return $http({
method: 'PUT',
url: '/api/ffmpeg-settings',
data: angular.toJson(config),
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
resetFfmpegSettings: (config) => {
return $http({
method: 'POST',
url: '/api/ffmpeg-settings',
data: angular.toJson(config),
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
getXmltvSettings: () => {
return $http.get('/api/xmltv-settings').then((d) => { return d.data })
},
updateXmltvSettings: (config) => {
return $http({
method: 'PUT',
url: '/api/xmltv-settings',
data: angular.toJson(config),
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
resetXmltvSettings: (config) => {
return $http({
method: 'POST',
url: '/api/xmltv-settings',
data: angular.toJson(config),
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
getHdhrSettings: () => {
return $http.get('/api/hdhr-settings').then((d) => { return d.data })
},
updateHdhrSettings: (config) => {
return $http({
method: 'PUT',
url: '/api/hdhr-settings',
data: angular.toJson(config),
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
resetHdhrSettings: (config) => {
return $http({
method: 'POST',
url: '/api/hdhr-settings',
data: angular.toJson(config),
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
getChannels: () => {
return $http.get('/api/channels').then((d) => { return d.data })
},
addChannel: (channel) => {
return $http({
method: 'POST',
url: '/api/channels',
data: angular.toJson(channel),
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
updateChannel: (channel) => {
return $http({
method: 'PUT',
url: '/api/channels',
data: angular.toJson(channel),
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
},
removeChannel: (channel) => {
return $http({
method: 'DELETE',
url: '/api/channels',
data: angular.toJson(channel),
headers: { 'Content-Type': 'application/json; charset=utf-8' }
}).then((d) => { return d.data })
}
}
}