Connect to v1 server

This commit is contained in:
Araozu 2024-02-29 14:37:17 -05:00
parent e9fdba58b3
commit 7daf646488
5 changed files with 24 additions and 31 deletions

View File

@ -58,7 +58,6 @@
vm = this vm = this
animes = @$store.state.animes animes = @$store.state.animes
resultado = -1 resultado = -1
console.log animes
for anime in animes for anime in animes
console.log "Param is #{@$route.params.nombre}" console.log "Param is #{@$route.params.nombre}"
if anime.link is "/Anime/" + @$route.params.nombre if anime.link is "/Anime/" + @$route.params.nombre

View File

@ -52,33 +52,27 @@
"https://www.youtube.com/results?search_query=" + (encodeURIComponent "#{nombre} - #{artista}") "https://www.youtube.com/results?search_query=" + (encodeURIComponent "#{nombre} - #{artista}")
mounted: -> mounted: ->
vm = this vm = this
fetch "#{this.$store.state.servidor}/op/#{this.anime_ID}", fetch "#{this.$store.state.servidor2}/op/#{this.anime_ID}"
method: "POST"
headers:
"Content-Type": "application/x-www-form-urlencoded"
.then (res) -> .then (res) ->
data = YAML.parse(await res.text()) data = YAML.parse(await res.text())
vm.estadoOp = vm.estadoOp =
if data.exito if res.status == 200
vm.ops = data.payload vm.ops = data
1 1
else else
console.error data.error console.error "Error recuperando OPs", data
-1 -1
.catch (err) -> console.log "Error :c #{err}" .catch (err) -> console.log "Error :c #{err}"
fetch "#{this.$store.state.servidor}/ed/#{this.anime_ID}", fetch "#{this.$store.state.servidor2}/ed/#{this.anime_ID}"
method: "POST"
headers:
"Content-Type": "application/x-www-form-urlencoded"
.then (res) -> .then (res) ->
data = YAML.parse(await res.text()) data = YAML.parse(await res.text())
vm.estadoEd = vm.estadoEd =
if data.exito if res.status == 200
vm.eds = data.payload vm.eds = data
1 1
else else
console.error data.error console.error "Error recuperando EDs", data
-1 -1
.catch (err) -> console.log "Error :c #{err}" .catch (err) -> console.log "Error :c #{err}"
# #

View File

@ -45,7 +45,7 @@
escala = if escala is 1 then 0.3 else 1 escala = if escala is 1 then 0.3 else 1
), 500 ), 500
ruta = if @suscrito then "/n/desubscribir/" else "/n/subscribir/" ruta = @$store.state.servidor + if @suscrito then "/n/desubscribir/" else "/n/subscribir/"
res = await fetch ruta, res = await fetch ruta,
method: "POST" method: "POST"

View File

@ -102,7 +102,6 @@
vm.mostrarSpinnerParaCargaDeEps = false vm.mostrarSpinnerParaCargaDeEps = false
vm.datos = opciones.map (opcion) => vm.datos = opciones.map (opcion) =>
episodios = eps.filter (ep) => ep.opcion_id == opcion.opcion_id episodios = eps.filter (ep) => ep.opcion_id == opcion.opcion_id
console.log episodios
{ eps: episodios, opcion... } { eps: episodios, opcion... }
vm.datosCorrectos = true vm.datosCorrectos = true

View File

@ -15,6 +15,7 @@ almacenarEnLocalStorage = (clave, valor, fnActualizar) =>
export default new Vuex.Store export default new Vuex.Store
state: state:
servidor: "" servidor: ""
servidor2: "http://localhost:3485"
animes: animes:
if localStorage? if localStorage?