Connect to v1 server

master
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,35 +52,29 @@
"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" .then (res) ->
headers: data = YAML.parse(await res.text())
"Content-Type": "application/x-www-form-urlencoded" vm.estadoOp =
.then (res) -> if res.status == 200
data = YAML.parse(await res.text()) vm.ops = data
vm.estadoOp = 1
if data.exito else
vm.ops = data.payload console.error "Error recuperando OPs", data
1 -1
else .catch (err) -> console.log "Error :c #{err}"
console.error data.error
-1
.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" .then (res) ->
headers: data = YAML.parse(await res.text())
"Content-Type": "application/x-www-form-urlencoded" vm.estadoEd =
.then (res) -> if res.status == 200
data = YAML.parse(await res.text()) vm.eds = data
vm.estadoEd = 1
if data.exito else
vm.eds = data.payload console.error "Error recuperando EDs", data
1 -1
else .catch (err) -> console.log "Error :c #{err}"
console.error data.error
-1
.catch (err) -> console.log "Error :c #{err}"
# #
</script> </script>

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?