@golstats/gsc-lineups-reports 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/css/fonts.css +91 -91
- package/dist/gsc-lineups-reports.css +1 -1
- package/dist/gsc-lineups-reports.es.js +3135 -2751
- package/dist/gsc-lineups-reports.umd.js +10 -7
- package/dist/images/canchaRPH.svg +30 -30
- package/dist/images/events/atajada.svg +56 -56
- package/dist/images/events/fin-del-partido.svg +43 -43
- package/dist/images/events/fuera-de-lugar.svg +57 -57
- package/dist/images/events/gol.svg +48 -48
- package/dist/images/events/icn-cambio.svg +6 -6
- package/dist/images/events/icn-falta.svg +4 -4
- package/dist/images/events/icn-play.svg +3 -3
- package/dist/images/events/icn-tarjeta-amarilla.svg +3 -3
- package/dist/images/events/icn-tarjeta-roja.svg +3 -3
- package/dist/images/events/icn-tiro-a-porteria.svg +36 -36
- package/dist/images/events/icn-tiros-de-esquina.svg +18 -18
- package/dist/images/events/inicia-el-partido.svg +45 -45
- package/dist/images/events/jugada-peligrosa.svg +90 -90
- package/dist/images/events/penal-fallado.svg +194 -194
- package/dist/images/events/penal-marcado.svg +189 -189
- package/dist/images/events/tiempo-agregado.svg +74 -74
- package/dist/images/events/tiro-a-porteria.svg +80 -80
- package/dist/images/events/var.svg +30 -30
- package/package.json +7 -3
- package/src/components/Lineup2D/CheckBox.vue +42 -42
- package/src/components/Lineup2D/FilterEmpty.vue +48 -48
- package/src/components/Lineup2D/Icons.vue +29 -29
- package/src/components/Lineup2D/LineupField.vue +274 -274
- package/src/components/Lineup2D/LineupFilter.vue +285 -285
- package/src/components/Lineup2D/LineupMainHeader.vue +222 -222
- package/src/components/Lineup2D/LineupRecentItem.vue +110 -110
- package/src/components/Lineup2D/MatchDetails.vue +66 -66
- package/src/components/gsc-filter.vue +286 -286
- package/src/components/gsc-header-historico-lineup.vue +1064 -1064
- package/src/components/gsc-header-postmatch-lineup.vue +1017 -1017
- package/src/components/gsc-header-probables-lineup.vue +1044 -1044
- package/src/components/gsc-header-recientes-lineup.vue +2337 -2337
- package/src/components/gsc-lineup-dosd.vue +3777 -3752
- package/src/components/gsc-lineup-main.vue +81 -65
- package/src/components/gsc-lineups-reports.vue +10 -1
- package/src/components/gsc-lineups.vue +229 -37
- package/src/components/gsc-player-card.vue +166 -166
- package/src/index.js +4 -4
- package/src/main-test.js +42 -0
- package/src/types.d.ts +45 -45
- package/src/utils/apiUrl.js +33 -0
- package/src/utils/socketConnection.js +29 -29
|
@@ -1,65 +1,81 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<template v-if="type == '2D'">
|
|
4
|
-
<GSCLineups2D
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
:
|
|
9
|
-
:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
type:
|
|
37
|
-
default:
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
type:
|
|
41
|
-
default:
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
type:
|
|
45
|
-
default:
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
type:
|
|
49
|
-
default:
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<template v-if="type == '2D'">
|
|
4
|
+
<GSCLineups2D
|
|
5
|
+
:selected-option="selectedOption"
|
|
6
|
+
:game="game"
|
|
7
|
+
:socket="socket"
|
|
8
|
+
:provider="provider"
|
|
9
|
+
:is-dev-apis="isDevApis"
|
|
10
|
+
/>
|
|
11
|
+
</template>
|
|
12
|
+
<template v-if="type == '3D'">
|
|
13
|
+
<GSCLineups3D
|
|
14
|
+
:is-live="isLive"
|
|
15
|
+
:isFemale="isFemale"
|
|
16
|
+
@onOpenProfile="onOpenProfile"
|
|
17
|
+
:selected-option="selectedOption"
|
|
18
|
+
:game="game"
|
|
19
|
+
:socket="socket"
|
|
20
|
+
:provider="provider"
|
|
21
|
+
:is-dev-apis="isDevApis"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<script>
|
|
27
|
+
import GSCLineups2D from './gsc-lineup-dosd.vue'
|
|
28
|
+
import GSCLineups3D from './gsc-lineups.vue'
|
|
29
|
+
export default {
|
|
30
|
+
components: {
|
|
31
|
+
GSCLineups2D,
|
|
32
|
+
GSCLineups3D
|
|
33
|
+
},
|
|
34
|
+
props: {
|
|
35
|
+
isFemale: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
39
|
+
selectedOption: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'Historicos'
|
|
42
|
+
},
|
|
43
|
+
game: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: () => {}
|
|
46
|
+
},
|
|
47
|
+
isLive: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
50
|
+
},
|
|
51
|
+
type: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: '2D'
|
|
54
|
+
},
|
|
55
|
+
socket: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => {}
|
|
58
|
+
},
|
|
59
|
+
provider: {
|
|
60
|
+
type: Number,
|
|
61
|
+
default: 1
|
|
62
|
+
},
|
|
63
|
+
isDevApis: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
watch: {},
|
|
69
|
+
data() {
|
|
70
|
+
return {}
|
|
71
|
+
},
|
|
72
|
+
computed: {},
|
|
73
|
+
methods: {
|
|
74
|
+
onOpenProfile(data) {
|
|
75
|
+
this.$emit('onOpenProfile', data)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style module></style>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<!-- Aquí va tu contenido -->
|
|
4
3
|
<GSCLineups
|
|
5
4
|
:game="game"
|
|
6
5
|
:gamehome="lastHomeGame"
|
|
7
6
|
:gameaway="lastVisitingGame"
|
|
8
7
|
:selected-option="selectedOption"
|
|
8
|
+
:provider="provider"
|
|
9
|
+
:is-dev-apis="isDevApis"
|
|
9
10
|
/>
|
|
10
11
|
</div>
|
|
11
12
|
</template>
|
|
@@ -39,6 +40,14 @@ const props = defineProps({
|
|
|
39
40
|
type: String,
|
|
40
41
|
default: 'Prematch',
|
|
41
42
|
},
|
|
43
|
+
provider: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 1,
|
|
46
|
+
},
|
|
47
|
+
isDevApis: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false,
|
|
50
|
+
},
|
|
42
51
|
})
|
|
43
52
|
|
|
44
53
|
// Función para validar y formatear el objeto del juego
|
|
@@ -51,16 +51,6 @@
|
|
|
51
51
|
<!-- CANCHA - CANCHA - CANCHA - CANCHA - CANCHA - CANCHA - CANCHA - CANCHA -->
|
|
52
52
|
<!-- CANCHA - CANCHA - CANCHA - CANCHA - CANCHA - CANCHA - CANCHA - CANCHA -->
|
|
53
53
|
<div :class="canchacontainerClass">
|
|
54
|
-
<div
|
|
55
|
-
:class="[notificationnolineupsClass]"
|
|
56
|
-
v-if="
|
|
57
|
-
(gameForAnalysis.game_status == 4 || gameForAnalysis.game_status == 1) &&
|
|
58
|
-
gameForAnalysis.is_live == 0 &&
|
|
59
|
-
numPlayer == 0
|
|
60
|
-
"
|
|
61
|
-
>
|
|
62
|
-
Las alineaciones estarán disponibles unos minutos antes de que inicie el partido.
|
|
63
|
-
</div>
|
|
64
54
|
<template v-for="(data, key) in playersHome" :key="key + 'jersey_home'">
|
|
65
55
|
<template v-if="data.played">
|
|
66
56
|
<div
|
|
@@ -284,6 +274,7 @@
|
|
|
284
274
|
<script>
|
|
285
275
|
import axios from 'axios'
|
|
286
276
|
import { /*connectSocket,*/ connectChannel } from '@/utils/socketConnection'
|
|
277
|
+
import { getApiUrl } from '@/utils/apiUrl'
|
|
287
278
|
import CardPlayer from './gsc-player-card.vue'
|
|
288
279
|
import HeaderPlayerHistorico from './gsc-header-historico-lineup.vue'
|
|
289
280
|
import HeaderPlayerRecientes from './gsc-header-recientes-lineup.vue'
|
|
@@ -322,6 +313,14 @@ export default {
|
|
|
322
313
|
type: Object,
|
|
323
314
|
default: () => {},
|
|
324
315
|
},
|
|
316
|
+
provider: {
|
|
317
|
+
type: Number,
|
|
318
|
+
default: 1,
|
|
319
|
+
},
|
|
320
|
+
isDevApis: {
|
|
321
|
+
type: Boolean,
|
|
322
|
+
default: false,
|
|
323
|
+
},
|
|
325
324
|
},
|
|
326
325
|
components: {
|
|
327
326
|
CardPlayer,
|
|
@@ -440,6 +439,8 @@ export default {
|
|
|
440
439
|
pendingRequests: new Set(),
|
|
441
440
|
// Debounce timer para evitar peticiones excesivas
|
|
442
441
|
debounceTimer: null,
|
|
442
|
+
// Timer para evitar múltiples cargas de probables
|
|
443
|
+
probablesDebounceTimer: null,
|
|
443
444
|
matchdaysPerTeam: [],
|
|
444
445
|
lastGetGame: 0,
|
|
445
446
|
lastSection: '',
|
|
@@ -811,6 +812,18 @@ export default {
|
|
|
811
812
|
numPlayer() {
|
|
812
813
|
return Number(this.playersAway.length) + Number(this.playersHome.length)
|
|
813
814
|
},
|
|
815
|
+
shouldShowNoLineupsMessage() {
|
|
816
|
+
const condition =
|
|
817
|
+
(this.gameForAnalysis.game_status == 4 || this.gameForAnalysis.game_status == 1) &&
|
|
818
|
+
this.gameForAnalysis.is_live == 0 &&
|
|
819
|
+
this.numPlayer == 0
|
|
820
|
+
|
|
821
|
+
console.log(
|
|
822
|
+
`🔍 Condición mensaje: status=${this.gameForAnalysis.game_status}, is_live=${this.gameForAnalysis.is_live}, numPlayer=${this.numPlayer} -> ${condition}`,
|
|
823
|
+
)
|
|
824
|
+
|
|
825
|
+
return condition
|
|
826
|
+
},
|
|
814
827
|
benchFillHome() {
|
|
815
828
|
if (this.playersHome.length < this.playersAway.length) {
|
|
816
829
|
return this.playersAway.length - this.playersHome.length
|
|
@@ -838,6 +851,15 @@ export default {
|
|
|
838
851
|
}
|
|
839
852
|
}
|
|
840
853
|
},
|
|
854
|
+
beforeUnmount() {
|
|
855
|
+
// Limpiar timers para evitar memory leaks
|
|
856
|
+
if (this.probablesDebounceTimer) {
|
|
857
|
+
clearTimeout(this.probablesDebounceTimer)
|
|
858
|
+
}
|
|
859
|
+
if (this.debounceTimer) {
|
|
860
|
+
clearTimeout(this.debounceTimer)
|
|
861
|
+
}
|
|
862
|
+
},
|
|
841
863
|
watch: {
|
|
842
864
|
/*'homeTeam.acronym': {
|
|
843
865
|
handler(newValue) {
|
|
@@ -859,7 +881,12 @@ export default {
|
|
|
859
881
|
if (newValue != oldValue) {
|
|
860
882
|
if (this.selectedOption !== 'Postmatch') {
|
|
861
883
|
if (newValue === 'Probables') {
|
|
862
|
-
|
|
884
|
+
// Limpiar timer anterior para evitar ejecuciones múltiples
|
|
885
|
+
if (this.probablesDebounceTimer) {
|
|
886
|
+
clearTimeout(this.probablesDebounceTimer)
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
this.probablesDebounceTimer = setTimeout(async () => {
|
|
863
890
|
// Validar que los game_id sean válidos antes de proceder
|
|
864
891
|
if (
|
|
865
892
|
this.gamehome &&
|
|
@@ -869,20 +896,80 @@ export default {
|
|
|
869
896
|
this.gameaway.game_id &&
|
|
870
897
|
this.gameaway.game_id !== 0
|
|
871
898
|
) {
|
|
872
|
-
|
|
873
|
-
|
|
899
|
+
// Verificar si ya se cargaron las alineaciones para estos game_ids
|
|
900
|
+
const alreadyLoaded = this.areProbablesAlreadyLoaded(
|
|
874
901
|
this.gamehome.game_id,
|
|
875
|
-
'Away:',
|
|
876
902
|
this.gameaway.game_id,
|
|
877
903
|
)
|
|
878
904
|
|
|
879
|
-
|
|
880
|
-
|
|
905
|
+
// Verificar si ya hay peticiones en curso
|
|
906
|
+
const requestsPending = this.areProbablesRequestsPending(
|
|
907
|
+
this.gamehome.game_id,
|
|
908
|
+
this.gameaway.game_id,
|
|
909
|
+
)
|
|
910
|
+
|
|
911
|
+
if (requestsPending) {
|
|
912
|
+
console.log('⏳ Peticiones de alineaciones probables ya en curso, saltando...')
|
|
913
|
+
return
|
|
914
|
+
}
|
|
881
915
|
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
916
|
+
if (!alreadyLoaded) {
|
|
917
|
+
console.log(
|
|
918
|
+
'✅ Cargando alineaciones probables - Home:',
|
|
919
|
+
this.gamehome.game_id,
|
|
920
|
+
'Away:',
|
|
921
|
+
this.gameaway.game_id,
|
|
922
|
+
)
|
|
923
|
+
|
|
924
|
+
this.auxProbablesIDGameHome = this.gamehome.game_id
|
|
925
|
+
this.auxProbablesIDGameAway = this.gameaway.game_id
|
|
926
|
+
|
|
927
|
+
console.log('🧹 Limpiando datos antes de cargar nuevas alineaciones...')
|
|
928
|
+
this.cleaneDataAway()
|
|
929
|
+
this.cleaneDataHome()
|
|
930
|
+
console.log(
|
|
931
|
+
'📊 Estado después de limpiar - Home:',
|
|
932
|
+
this.playersHome.length,
|
|
933
|
+
'Away:',
|
|
934
|
+
this.playersAway.length,
|
|
935
|
+
)
|
|
936
|
+
|
|
937
|
+
// Obtener información del header antes de cargar las alineaciones
|
|
938
|
+
console.log('📋 Obteniendo información del header para probables...')
|
|
939
|
+
try {
|
|
940
|
+
// Verificar que la prop game esté disponible
|
|
941
|
+
if (!this.game || !this.game.game_id) {
|
|
942
|
+
console.warn('❌ Prop game no disponible para obtener header info')
|
|
943
|
+
return
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
// Usar la prop game para obtener el header info del partido principal
|
|
947
|
+
await this.getHeaderInfo(this.game)
|
|
948
|
+
console.log(
|
|
949
|
+
'✅ Header info obtenido para el partido principal:',
|
|
950
|
+
this.game.game_id,
|
|
951
|
+
)
|
|
952
|
+
} catch (error) {
|
|
953
|
+
console.error('❌ Error obteniendo header info:', error)
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
this.getLineUpProbablesHome3D(this.gamehome.game_id)
|
|
957
|
+
this.getLineUpProbablesAway3D(this.gameaway.game_id)
|
|
958
|
+
|
|
959
|
+
// Log del estado actual después de iniciar las peticiones
|
|
960
|
+
setTimeout(() => {
|
|
961
|
+
console.log(
|
|
962
|
+
`📊 Estado después de iniciar peticiones - Home: ${this.playersHome.length}, Away: ${this.playersAway.length}, numPlayer: ${this.numPlayer}`,
|
|
963
|
+
)
|
|
964
|
+
}, 100)
|
|
965
|
+
} else {
|
|
966
|
+
console.log(
|
|
967
|
+
'⏭️ Alineaciones probables ya cargadas para estos game_ids - Home:',
|
|
968
|
+
this.gamehome.game_id,
|
|
969
|
+
'Away:',
|
|
970
|
+
this.gameaway.game_id,
|
|
971
|
+
)
|
|
972
|
+
}
|
|
886
973
|
} else {
|
|
887
974
|
console.warn(
|
|
888
975
|
'❌ No se pueden cargar alineaciones probables - game_id inválidos:',
|
|
@@ -911,6 +998,25 @@ export default {
|
|
|
911
998
|
}
|
|
912
999
|
},
|
|
913
1000
|
},
|
|
1001
|
+
numPlayer: {
|
|
1002
|
+
handler(newValue, oldValue) {
|
|
1003
|
+
if (newValue !== oldValue) {
|
|
1004
|
+
console.log(
|
|
1005
|
+
`👥 numPlayer cambió de ${oldValue} a ${newValue} (Home: ${this.playersHome.length}, Away: ${this.playersAway.length})`,
|
|
1006
|
+
)
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
},
|
|
1010
|
+
'gameForAnalysis.game_status': {
|
|
1011
|
+
handler(newValue) {
|
|
1012
|
+
console.log(`🎮 game_status cambió a: ${newValue}`)
|
|
1013
|
+
},
|
|
1014
|
+
},
|
|
1015
|
+
'gameForAnalysis.is_live': {
|
|
1016
|
+
handler(newValue) {
|
|
1017
|
+
console.log(`📡 is_live cambió a: ${newValue}`)
|
|
1018
|
+
},
|
|
1019
|
+
},
|
|
914
1020
|
'socket.connected': {
|
|
915
1021
|
immediate: true,
|
|
916
1022
|
handler(newValue) {
|
|
@@ -933,7 +1039,11 @@ export default {
|
|
|
933
1039
|
this.cleaneData()
|
|
934
1040
|
await this.getHeaderInfo(newValue)
|
|
935
1041
|
const gameDataInfoPromise = axios.get(
|
|
936
|
-
|
|
1042
|
+
getApiUrl(
|
|
1043
|
+
this.urlGames + newValue.season_id + '/games/' + newValue.game_id,
|
|
1044
|
+
this.provider,
|
|
1045
|
+
this.isDevApis,
|
|
1046
|
+
),
|
|
937
1047
|
axiosConfig,
|
|
938
1048
|
)
|
|
939
1049
|
const promises = [gameDataInfoPromise]
|
|
@@ -952,7 +1062,10 @@ export default {
|
|
|
952
1062
|
lineUpsGameId !== this.lastGetLineUpGameId
|
|
953
1063
|
) {
|
|
954
1064
|
console.log('✅ Haciendo petición de alineaciones para game_id:', lineUpsGameId)
|
|
955
|
-
lineUpsPromise = axios.get(
|
|
1065
|
+
lineUpsPromise = axios.get(
|
|
1066
|
+
getApiUrl(this.url + lineUpsGameId, this.provider, this.isDevApis),
|
|
1067
|
+
axiosConfig,
|
|
1068
|
+
)
|
|
956
1069
|
promises.push(lineUpsPromise)
|
|
957
1070
|
} else if (lineUpsGameId === 0) {
|
|
958
1071
|
console.warn('❌ Se evitó petición con game_id = 0')
|
|
@@ -1864,6 +1977,16 @@ export default {
|
|
|
1864
1977
|
this.pendingRequests.delete(requestKey)
|
|
1865
1978
|
console.log(`🔓 Removiendo petición pendiente: ${requestKey}`)
|
|
1866
1979
|
},
|
|
1980
|
+
// Función para verificar si las alineaciones probables ya están cargadas
|
|
1981
|
+
areProbablesAlreadyLoaded(homeGameId, awayGameId) {
|
|
1982
|
+
return (
|
|
1983
|
+
this.auxProbablesIDGameHome === homeGameId && this.auxProbablesIDGameAway === awayGameId
|
|
1984
|
+
)
|
|
1985
|
+
},
|
|
1986
|
+
// Función para verificar si hay peticiones pendientes para probables
|
|
1987
|
+
areProbablesRequestsPending(homeGameId, awayGameId) {
|
|
1988
|
+
return this.isRequestPending(homeGameId, 'home') || this.isRequestPending(awayGameId, 'away')
|
|
1989
|
+
},
|
|
1867
1990
|
// Función para calcular el ajuste de perspectiva basado en la posición X
|
|
1868
1991
|
calculatePerspectiveAdjustment(positionX) {
|
|
1869
1992
|
// Fórmula progresiva: cuanto menor sea positionX, mayor será el ajuste
|
|
@@ -1896,6 +2019,7 @@ export default {
|
|
|
1896
2019
|
this.$emit('onOpenProfile', data)
|
|
1897
2020
|
},
|
|
1898
2021
|
async getLineUpProbablesHome3D(game) {
|
|
2022
|
+
console.log('🏠 Iniciando petición de alineaciones probables HOME para game_id:', game)
|
|
1899
2023
|
if (game == null || game === 0) {
|
|
1900
2024
|
console.warn(
|
|
1901
2025
|
'❌ getLineUpProbablesHome3D: Se intentó hacer petición con game_id inválido:',
|
|
@@ -1904,6 +2028,20 @@ export default {
|
|
|
1904
2028
|
return
|
|
1905
2029
|
}
|
|
1906
2030
|
|
|
2031
|
+
// Verificar si gameInfoheader está disponible
|
|
2032
|
+
if (!this.gameInfoheader) {
|
|
2033
|
+
console.warn('❌ getLineUpProbablesHome3D: gameInfoheader no está disponible')
|
|
2034
|
+
return
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
// Verificar que gameInfoheader corresponde al partido correcto
|
|
2038
|
+
if (this.game && this.gameInfoheader.id !== this.game.game_id) {
|
|
2039
|
+
console.warn(
|
|
2040
|
+
`❌ getLineUpProbablesHome3D: gameInfoheader (${this.gameInfoheader.id}) no corresponde al partido actual (${this.game.game_id})`,
|
|
2041
|
+
)
|
|
2042
|
+
return
|
|
2043
|
+
}
|
|
2044
|
+
|
|
1907
2045
|
// Verificar si ya hay una petición en curso para este game_id
|
|
1908
2046
|
if (this.isRequestPending(game, 'home')) {
|
|
1909
2047
|
console.warn(
|
|
@@ -1921,7 +2059,9 @@ export default {
|
|
|
1921
2059
|
Authorization: `${this.tokenPremium}`,
|
|
1922
2060
|
},
|
|
1923
2061
|
})
|
|
1924
|
-
const data = await axiosInstanceLineUp.get(
|
|
2062
|
+
const data = await axiosInstanceLineUp.get(
|
|
2063
|
+
getApiUrl(this.url + game, this.provider, this.isDevApis),
|
|
2064
|
+
)
|
|
1925
2065
|
if (!data || !data.data) {
|
|
1926
2066
|
throw new Error('There is not lineups for this game.')
|
|
1927
2067
|
}
|
|
@@ -1992,6 +2132,9 @@ export default {
|
|
|
1992
2132
|
(player) =>
|
|
1993
2133
|
player.player_id == data.data.home_team.starting_lineup[0].lineup[index].player_id,
|
|
1994
2134
|
)
|
|
2135
|
+
console.log(
|
|
2136
|
+
`🏠 Agregando jugador HOME: ${data.data.home_team.starting_lineup[0].lineup[index].player_name}`,
|
|
2137
|
+
)
|
|
1995
2138
|
this.playersHome.push({
|
|
1996
2139
|
played: true,
|
|
1997
2140
|
name: data.data.home_team.starting_lineup[0].lineup[index].player_name,
|
|
@@ -2399,6 +2542,7 @@ export default {
|
|
|
2399
2542
|
console.log(
|
|
2400
2543
|
`✅ getLineUpProbablesHome3D: Petición completada exitosamente para game_id: ${game}`,
|
|
2401
2544
|
)
|
|
2545
|
+
console.log(`📊 Jugadores HOME cargados: ${this.playersHome.length}`)
|
|
2402
2546
|
} catch (e) {
|
|
2403
2547
|
// Remover la petición del estado pendiente en caso de error
|
|
2404
2548
|
this.removeRequestPending(game, 'home')
|
|
@@ -2486,6 +2630,7 @@ export default {
|
|
|
2486
2630
|
this.movil = false
|
|
2487
2631
|
},
|
|
2488
2632
|
async getLineUpProbablesAway3D(game) {
|
|
2633
|
+
console.log('✈️ Iniciando petición de alineaciones probables AWAY para game_id:', game)
|
|
2489
2634
|
if (game == null || game === 0) {
|
|
2490
2635
|
console.warn(
|
|
2491
2636
|
'❌ getLineUpProbablesAway3D: Se intentó hacer petición con game_id inválido:',
|
|
@@ -2494,6 +2639,20 @@ export default {
|
|
|
2494
2639
|
return
|
|
2495
2640
|
}
|
|
2496
2641
|
|
|
2642
|
+
// Verificar si gameInfoheader está disponible
|
|
2643
|
+
if (!this.gameInfoheader) {
|
|
2644
|
+
console.warn('❌ getLineUpProbablesAway3D: gameInfoheader no está disponible')
|
|
2645
|
+
return
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
// Verificar que gameInfoheader corresponde al partido correcto
|
|
2649
|
+
if (this.game && this.gameInfoheader.id !== this.game.game_id) {
|
|
2650
|
+
console.warn(
|
|
2651
|
+
`❌ getLineUpProbablesAway3D: gameInfoheader (${this.gameInfoheader.id}) no corresponde al partido actual (${this.game.game_id})`,
|
|
2652
|
+
)
|
|
2653
|
+
return
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2497
2656
|
// Verificar si ya hay una petición en curso para este game_id
|
|
2498
2657
|
if (this.isRequestPending(game, 'away')) {
|
|
2499
2658
|
console.warn(
|
|
@@ -2511,7 +2670,9 @@ export default {
|
|
|
2511
2670
|
Authorization: `${this.tokenPremium}`,
|
|
2512
2671
|
},
|
|
2513
2672
|
})
|
|
2514
|
-
const data = await axiosInstanceLineUp.get(
|
|
2673
|
+
const data = await axiosInstanceLineUp.get(
|
|
2674
|
+
getApiUrl(this.url + game, this.provider, this.isDevApis),
|
|
2675
|
+
)
|
|
2515
2676
|
if (!data || !data.data) {
|
|
2516
2677
|
throw new Error('There is not lineups for this game.')
|
|
2517
2678
|
}
|
|
@@ -2586,6 +2747,9 @@ export default {
|
|
|
2586
2747
|
(player) =>
|
|
2587
2748
|
player.player_id == data.data.home_team.starting_lineup[0].lineup[index].player_id,
|
|
2588
2749
|
)
|
|
2750
|
+
console.log(
|
|
2751
|
+
`✈️ Agregando jugador AWAY: ${data.data.home_team.starting_lineup[0].lineup[index].player_name}`,
|
|
2752
|
+
)
|
|
2589
2753
|
this.playersAway.push({
|
|
2590
2754
|
played: true,
|
|
2591
2755
|
name: data.data.home_team.starting_lineup[0].lineup[index].player_name,
|
|
@@ -2985,6 +3149,7 @@ export default {
|
|
|
2985
3149
|
console.log(
|
|
2986
3150
|
`✅ getLineUpProbablesAway3D: Petición completada exitosamente para game_id: ${game}`,
|
|
2987
3151
|
)
|
|
3152
|
+
console.log(`📊 Jugadores AWAY cargados: ${this.playersAway.length}`)
|
|
2988
3153
|
} catch (e) {
|
|
2989
3154
|
// Remover la petición del estado pendiente en caso de error
|
|
2990
3155
|
this.removeRequestPending(game, 'away')
|
|
@@ -2998,8 +3163,8 @@ export default {
|
|
|
2998
3163
|
console.log('✅ getLineupProbablesHome: Cargando alineaciones para game_id:', val.id)
|
|
2999
3164
|
this.auxProbablesIDGameHome = val.id
|
|
3000
3165
|
//this.homeTeam.acronym = this.awayTeamAbrev
|
|
3001
|
-
this.cleaneDataHome()
|
|
3002
|
-
this.getLineUpProbablesHome3D(val.id)
|
|
3166
|
+
//this.cleaneDataHome()
|
|
3167
|
+
//this.getLineUpProbablesHome3D(val.id)
|
|
3003
3168
|
}
|
|
3004
3169
|
} else {
|
|
3005
3170
|
console.warn('❌ getLineupProbablesHome: game_id inválido:', val?.id)
|
|
@@ -3011,8 +3176,8 @@ export default {
|
|
|
3011
3176
|
console.log('✅ getLineupProbablesAway: Cargando alineaciones para game_id:', val.id)
|
|
3012
3177
|
this.auxProbablesIDGameAway = val.id
|
|
3013
3178
|
//this.visitingTeam.acronym = this.awayTeamAbrev
|
|
3014
|
-
this.cleaneDataAway()
|
|
3015
|
-
this.getLineUpProbablesAway3D(val.id)
|
|
3179
|
+
//this.cleaneDataAway()
|
|
3180
|
+
//this.getLineUpProbablesAway3D(val.id)
|
|
3016
3181
|
}
|
|
3017
3182
|
} else {
|
|
3018
3183
|
console.warn('❌ getLineupProbablesAway: game_id inválido:', val?.id)
|
|
@@ -3077,13 +3242,27 @@ export default {
|
|
|
3077
3242
|
const data =
|
|
3078
3243
|
responseData ||
|
|
3079
3244
|
(await axiosInstance.get(
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3245
|
+
getApiUrl(
|
|
3246
|
+
'https://fxtcaw9tw6.execute-api.us-east-2.amazonaws.com/prod/historic/seasons/' +
|
|
3247
|
+
game.season_id +
|
|
3248
|
+
'/games/' +
|
|
3249
|
+
game.game_id +
|
|
3250
|
+
'/lineups',
|
|
3251
|
+
this.provider,
|
|
3252
|
+
this.isDevApis,
|
|
3253
|
+
),
|
|
3085
3254
|
))
|
|
3255
|
+
console.log(
|
|
3256
|
+
'GAME INFO HEADER --------------------------------------------------------> ',
|
|
3257
|
+
game.game_id,
|
|
3258
|
+
)
|
|
3086
3259
|
this.gameInfoheader = data.data.game
|
|
3260
|
+
console.log(
|
|
3261
|
+
'📋 gameInfoheader establecido para game_id:',
|
|
3262
|
+
this.gameInfoheader.id,
|
|
3263
|
+
'del partido:',
|
|
3264
|
+
game.game_id,
|
|
3265
|
+
)
|
|
3087
3266
|
if (this.selectedOption != 'Postmatch') {
|
|
3088
3267
|
for (let index = 0; index < data.data.games_historic.length; index++) {
|
|
3089
3268
|
this.gamesHistoric.push({
|
|
@@ -3162,7 +3341,13 @@ export default {
|
|
|
3162
3341
|
})
|
|
3163
3342
|
const data =
|
|
3164
3343
|
responseData ||
|
|
3165
|
-
(await axiosInstance.get(
|
|
3344
|
+
(await axiosInstance.get(
|
|
3345
|
+
getApiUrl(
|
|
3346
|
+
this.urlGames + game.season_id + '/games/' + game.game_id,
|
|
3347
|
+
this.provider,
|
|
3348
|
+
this.isDevApis,
|
|
3349
|
+
),
|
|
3350
|
+
))
|
|
3166
3351
|
this.homeTeam = data.data.teams[0]
|
|
3167
3352
|
//this.homeTeamAbrev = data.data.teams[0].acronym
|
|
3168
3353
|
//this.awayTeamAbrev = data.data.teams[1].acronym
|
|
@@ -3316,7 +3501,7 @@ export default {
|
|
|
3316
3501
|
},
|
|
3317
3502
|
async getMXM(game) {
|
|
3318
3503
|
try {
|
|
3319
|
-
const getMXMUrl = this.urlMXM + game
|
|
3504
|
+
const getMXMUrl = getApiUrl(this.urlMXM + game, this.provider, this.isDevApis)
|
|
3320
3505
|
if (getMXMUrl === this.lastMXMUrl) {
|
|
3321
3506
|
return
|
|
3322
3507
|
}
|
|
@@ -3500,7 +3685,10 @@ export default {
|
|
|
3500
3685
|
console.warn('❌ getLineUp: Se intentó hacer petición con game_id inválido:', game)
|
|
3501
3686
|
return
|
|
3502
3687
|
}
|
|
3503
|
-
|
|
3688
|
+
console.log(
|
|
3689
|
+
'------------------------------------------------> SE HIZO LA PETICION ----> DEL PARTIDO ID: ',
|
|
3690
|
+
game,
|
|
3691
|
+
)
|
|
3504
3692
|
// Verificar si ya hay una petición en curso para este game_id
|
|
3505
3693
|
if (this.isRequestPending(game, 'general')) {
|
|
3506
3694
|
console.warn(`🔒 getLineUp: Ya hay una petición en curso para game_id: ${game}`)
|
|
@@ -3518,7 +3706,11 @@ export default {
|
|
|
3518
3706
|
Authorization: `${this.tokenPremium}`,
|
|
3519
3707
|
},
|
|
3520
3708
|
})
|
|
3521
|
-
const data =
|
|
3709
|
+
const data =
|
|
3710
|
+
responseData ||
|
|
3711
|
+
(await axiosInstanceLineUp.get(
|
|
3712
|
+
getApiUrl(this.url + game, this.provider, this.isDevApis),
|
|
3713
|
+
))
|
|
3522
3714
|
if (!data || !data.data) {
|
|
3523
3715
|
throw new Error('There is not lineups for this game.')
|
|
3524
3716
|
}
|