@golstats/gsc-lineups-reports 1.0.8 → 1.0.9
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/package.json
CHANGED
|
@@ -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
|
|
@@ -440,6 +430,8 @@ export default {
|
|
|
440
430
|
pendingRequests: new Set(),
|
|
441
431
|
// Debounce timer para evitar peticiones excesivas
|
|
442
432
|
debounceTimer: null,
|
|
433
|
+
// Timer para evitar múltiples cargas de probables
|
|
434
|
+
probablesDebounceTimer: null,
|
|
443
435
|
matchdaysPerTeam: [],
|
|
444
436
|
lastGetGame: 0,
|
|
445
437
|
lastSection: '',
|
|
@@ -811,6 +803,18 @@ export default {
|
|
|
811
803
|
numPlayer() {
|
|
812
804
|
return Number(this.playersAway.length) + Number(this.playersHome.length)
|
|
813
805
|
},
|
|
806
|
+
shouldShowNoLineupsMessage() {
|
|
807
|
+
const condition =
|
|
808
|
+
(this.gameForAnalysis.game_status == 4 || this.gameForAnalysis.game_status == 1) &&
|
|
809
|
+
this.gameForAnalysis.is_live == 0 &&
|
|
810
|
+
this.numPlayer == 0
|
|
811
|
+
|
|
812
|
+
console.log(
|
|
813
|
+
`🔍 Condición mensaje: status=${this.gameForAnalysis.game_status}, is_live=${this.gameForAnalysis.is_live}, numPlayer=${this.numPlayer} -> ${condition}`,
|
|
814
|
+
)
|
|
815
|
+
|
|
816
|
+
return condition
|
|
817
|
+
},
|
|
814
818
|
benchFillHome() {
|
|
815
819
|
if (this.playersHome.length < this.playersAway.length) {
|
|
816
820
|
return this.playersAway.length - this.playersHome.length
|
|
@@ -838,6 +842,15 @@ export default {
|
|
|
838
842
|
}
|
|
839
843
|
}
|
|
840
844
|
},
|
|
845
|
+
beforeUnmount() {
|
|
846
|
+
// Limpiar timers para evitar memory leaks
|
|
847
|
+
if (this.probablesDebounceTimer) {
|
|
848
|
+
clearTimeout(this.probablesDebounceTimer)
|
|
849
|
+
}
|
|
850
|
+
if (this.debounceTimer) {
|
|
851
|
+
clearTimeout(this.debounceTimer)
|
|
852
|
+
}
|
|
853
|
+
},
|
|
841
854
|
watch: {
|
|
842
855
|
/*'homeTeam.acronym': {
|
|
843
856
|
handler(newValue) {
|
|
@@ -859,7 +872,12 @@ export default {
|
|
|
859
872
|
if (newValue != oldValue) {
|
|
860
873
|
if (this.selectedOption !== 'Postmatch') {
|
|
861
874
|
if (newValue === 'Probables') {
|
|
862
|
-
|
|
875
|
+
// Limpiar timer anterior para evitar ejecuciones múltiples
|
|
876
|
+
if (this.probablesDebounceTimer) {
|
|
877
|
+
clearTimeout(this.probablesDebounceTimer)
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
this.probablesDebounceTimer = setTimeout(async () => {
|
|
863
881
|
// Validar que los game_id sean válidos antes de proceder
|
|
864
882
|
if (
|
|
865
883
|
this.gamehome &&
|
|
@@ -869,20 +887,80 @@ export default {
|
|
|
869
887
|
this.gameaway.game_id &&
|
|
870
888
|
this.gameaway.game_id !== 0
|
|
871
889
|
) {
|
|
872
|
-
|
|
873
|
-
|
|
890
|
+
// Verificar si ya se cargaron las alineaciones para estos game_ids
|
|
891
|
+
const alreadyLoaded = this.areProbablesAlreadyLoaded(
|
|
892
|
+
this.gamehome.game_id,
|
|
893
|
+
this.gameaway.game_id,
|
|
894
|
+
)
|
|
895
|
+
|
|
896
|
+
// Verificar si ya hay peticiones en curso
|
|
897
|
+
const requestsPending = this.areProbablesRequestsPending(
|
|
874
898
|
this.gamehome.game_id,
|
|
875
|
-
'Away:',
|
|
876
899
|
this.gameaway.game_id,
|
|
877
900
|
)
|
|
878
901
|
|
|
879
|
-
|
|
880
|
-
|
|
902
|
+
if (requestsPending) {
|
|
903
|
+
console.log('⏳ Peticiones de alineaciones probables ya en curso, saltando...')
|
|
904
|
+
return
|
|
905
|
+
}
|
|
881
906
|
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
907
|
+
if (!alreadyLoaded) {
|
|
908
|
+
console.log(
|
|
909
|
+
'✅ Cargando alineaciones probables - Home:',
|
|
910
|
+
this.gamehome.game_id,
|
|
911
|
+
'Away:',
|
|
912
|
+
this.gameaway.game_id,
|
|
913
|
+
)
|
|
914
|
+
|
|
915
|
+
this.auxProbablesIDGameHome = this.gamehome.game_id
|
|
916
|
+
this.auxProbablesIDGameAway = this.gameaway.game_id
|
|
917
|
+
|
|
918
|
+
console.log('🧹 Limpiando datos antes de cargar nuevas alineaciones...')
|
|
919
|
+
this.cleaneDataAway()
|
|
920
|
+
this.cleaneDataHome()
|
|
921
|
+
console.log(
|
|
922
|
+
'📊 Estado después de limpiar - Home:',
|
|
923
|
+
this.playersHome.length,
|
|
924
|
+
'Away:',
|
|
925
|
+
this.playersAway.length,
|
|
926
|
+
)
|
|
927
|
+
|
|
928
|
+
// Obtener información del header antes de cargar las alineaciones
|
|
929
|
+
console.log('📋 Obteniendo información del header para probables...')
|
|
930
|
+
try {
|
|
931
|
+
// Verificar que la prop game esté disponible
|
|
932
|
+
if (!this.game || !this.game.game_id) {
|
|
933
|
+
console.warn('❌ Prop game no disponible para obtener header info')
|
|
934
|
+
return
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
// Usar la prop game para obtener el header info del partido principal
|
|
938
|
+
await this.getHeaderInfo(this.game)
|
|
939
|
+
console.log(
|
|
940
|
+
'✅ Header info obtenido para el partido principal:',
|
|
941
|
+
this.game.game_id,
|
|
942
|
+
)
|
|
943
|
+
} catch (error) {
|
|
944
|
+
console.error('❌ Error obteniendo header info:', error)
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
this.getLineUpProbablesHome3D(this.gamehome.game_id)
|
|
948
|
+
this.getLineUpProbablesAway3D(this.gameaway.game_id)
|
|
949
|
+
|
|
950
|
+
// Log del estado actual después de iniciar las peticiones
|
|
951
|
+
setTimeout(() => {
|
|
952
|
+
console.log(
|
|
953
|
+
`📊 Estado después de iniciar peticiones - Home: ${this.playersHome.length}, Away: ${this.playersAway.length}, numPlayer: ${this.numPlayer}`,
|
|
954
|
+
)
|
|
955
|
+
}, 100)
|
|
956
|
+
} else {
|
|
957
|
+
console.log(
|
|
958
|
+
'⏭️ Alineaciones probables ya cargadas para estos game_ids - Home:',
|
|
959
|
+
this.gamehome.game_id,
|
|
960
|
+
'Away:',
|
|
961
|
+
this.gameaway.game_id,
|
|
962
|
+
)
|
|
963
|
+
}
|
|
886
964
|
} else {
|
|
887
965
|
console.warn(
|
|
888
966
|
'❌ No se pueden cargar alineaciones probables - game_id inválidos:',
|
|
@@ -911,6 +989,25 @@ export default {
|
|
|
911
989
|
}
|
|
912
990
|
},
|
|
913
991
|
},
|
|
992
|
+
numPlayer: {
|
|
993
|
+
handler(newValue, oldValue) {
|
|
994
|
+
if (newValue !== oldValue) {
|
|
995
|
+
console.log(
|
|
996
|
+
`👥 numPlayer cambió de ${oldValue} a ${newValue} (Home: ${this.playersHome.length}, Away: ${this.playersAway.length})`,
|
|
997
|
+
)
|
|
998
|
+
}
|
|
999
|
+
},
|
|
1000
|
+
},
|
|
1001
|
+
'gameForAnalysis.game_status': {
|
|
1002
|
+
handler(newValue) {
|
|
1003
|
+
console.log(`🎮 game_status cambió a: ${newValue}`)
|
|
1004
|
+
},
|
|
1005
|
+
},
|
|
1006
|
+
'gameForAnalysis.is_live': {
|
|
1007
|
+
handler(newValue) {
|
|
1008
|
+
console.log(`📡 is_live cambió a: ${newValue}`)
|
|
1009
|
+
},
|
|
1010
|
+
},
|
|
914
1011
|
'socket.connected': {
|
|
915
1012
|
immediate: true,
|
|
916
1013
|
handler(newValue) {
|
|
@@ -1864,6 +1961,16 @@ export default {
|
|
|
1864
1961
|
this.pendingRequests.delete(requestKey)
|
|
1865
1962
|
console.log(`🔓 Removiendo petición pendiente: ${requestKey}`)
|
|
1866
1963
|
},
|
|
1964
|
+
// Función para verificar si las alineaciones probables ya están cargadas
|
|
1965
|
+
areProbablesAlreadyLoaded(homeGameId, awayGameId) {
|
|
1966
|
+
return (
|
|
1967
|
+
this.auxProbablesIDGameHome === homeGameId && this.auxProbablesIDGameAway === awayGameId
|
|
1968
|
+
)
|
|
1969
|
+
},
|
|
1970
|
+
// Función para verificar si hay peticiones pendientes para probables
|
|
1971
|
+
areProbablesRequestsPending(homeGameId, awayGameId) {
|
|
1972
|
+
return this.isRequestPending(homeGameId, 'home') || this.isRequestPending(awayGameId, 'away')
|
|
1973
|
+
},
|
|
1867
1974
|
// Función para calcular el ajuste de perspectiva basado en la posición X
|
|
1868
1975
|
calculatePerspectiveAdjustment(positionX) {
|
|
1869
1976
|
// Fórmula progresiva: cuanto menor sea positionX, mayor será el ajuste
|
|
@@ -1896,6 +2003,7 @@ export default {
|
|
|
1896
2003
|
this.$emit('onOpenProfile', data)
|
|
1897
2004
|
},
|
|
1898
2005
|
async getLineUpProbablesHome3D(game) {
|
|
2006
|
+
console.log('🏠 Iniciando petición de alineaciones probables HOME para game_id:', game)
|
|
1899
2007
|
if (game == null || game === 0) {
|
|
1900
2008
|
console.warn(
|
|
1901
2009
|
'❌ getLineUpProbablesHome3D: Se intentó hacer petición con game_id inválido:',
|
|
@@ -1904,6 +2012,20 @@ export default {
|
|
|
1904
2012
|
return
|
|
1905
2013
|
}
|
|
1906
2014
|
|
|
2015
|
+
// Verificar si gameInfoheader está disponible
|
|
2016
|
+
if (!this.gameInfoheader) {
|
|
2017
|
+
console.warn('❌ getLineUpProbablesHome3D: gameInfoheader no está disponible')
|
|
2018
|
+
return
|
|
2019
|
+
}
|
|
2020
|
+
|
|
2021
|
+
// Verificar que gameInfoheader corresponde al partido correcto
|
|
2022
|
+
if (this.game && this.gameInfoheader.id !== this.game.game_id) {
|
|
2023
|
+
console.warn(
|
|
2024
|
+
`❌ getLineUpProbablesHome3D: gameInfoheader (${this.gameInfoheader.id}) no corresponde al partido actual (${this.game.game_id})`,
|
|
2025
|
+
)
|
|
2026
|
+
return
|
|
2027
|
+
}
|
|
2028
|
+
|
|
1907
2029
|
// Verificar si ya hay una petición en curso para este game_id
|
|
1908
2030
|
if (this.isRequestPending(game, 'home')) {
|
|
1909
2031
|
console.warn(
|
|
@@ -1992,6 +2114,9 @@ export default {
|
|
|
1992
2114
|
(player) =>
|
|
1993
2115
|
player.player_id == data.data.home_team.starting_lineup[0].lineup[index].player_id,
|
|
1994
2116
|
)
|
|
2117
|
+
console.log(
|
|
2118
|
+
`🏠 Agregando jugador HOME: ${data.data.home_team.starting_lineup[0].lineup[index].player_name}`,
|
|
2119
|
+
)
|
|
1995
2120
|
this.playersHome.push({
|
|
1996
2121
|
played: true,
|
|
1997
2122
|
name: data.data.home_team.starting_lineup[0].lineup[index].player_name,
|
|
@@ -2399,6 +2524,7 @@ export default {
|
|
|
2399
2524
|
console.log(
|
|
2400
2525
|
`✅ getLineUpProbablesHome3D: Petición completada exitosamente para game_id: ${game}`,
|
|
2401
2526
|
)
|
|
2527
|
+
console.log(`📊 Jugadores HOME cargados: ${this.playersHome.length}`)
|
|
2402
2528
|
} catch (e) {
|
|
2403
2529
|
// Remover la petición del estado pendiente en caso de error
|
|
2404
2530
|
this.removeRequestPending(game, 'home')
|
|
@@ -2486,6 +2612,7 @@ export default {
|
|
|
2486
2612
|
this.movil = false
|
|
2487
2613
|
},
|
|
2488
2614
|
async getLineUpProbablesAway3D(game) {
|
|
2615
|
+
console.log('✈️ Iniciando petición de alineaciones probables AWAY para game_id:', game)
|
|
2489
2616
|
if (game == null || game === 0) {
|
|
2490
2617
|
console.warn(
|
|
2491
2618
|
'❌ getLineUpProbablesAway3D: Se intentó hacer petición con game_id inválido:',
|
|
@@ -2494,6 +2621,20 @@ export default {
|
|
|
2494
2621
|
return
|
|
2495
2622
|
}
|
|
2496
2623
|
|
|
2624
|
+
// Verificar si gameInfoheader está disponible
|
|
2625
|
+
if (!this.gameInfoheader) {
|
|
2626
|
+
console.warn('❌ getLineUpProbablesAway3D: gameInfoheader no está disponible')
|
|
2627
|
+
return
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
// Verificar que gameInfoheader corresponde al partido correcto
|
|
2631
|
+
if (this.game && this.gameInfoheader.id !== this.game.game_id) {
|
|
2632
|
+
console.warn(
|
|
2633
|
+
`❌ getLineUpProbablesAway3D: gameInfoheader (${this.gameInfoheader.id}) no corresponde al partido actual (${this.game.game_id})`,
|
|
2634
|
+
)
|
|
2635
|
+
return
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2497
2638
|
// Verificar si ya hay una petición en curso para este game_id
|
|
2498
2639
|
if (this.isRequestPending(game, 'away')) {
|
|
2499
2640
|
console.warn(
|
|
@@ -2586,6 +2727,9 @@ export default {
|
|
|
2586
2727
|
(player) =>
|
|
2587
2728
|
player.player_id == data.data.home_team.starting_lineup[0].lineup[index].player_id,
|
|
2588
2729
|
)
|
|
2730
|
+
console.log(
|
|
2731
|
+
`✈️ Agregando jugador AWAY: ${data.data.home_team.starting_lineup[0].lineup[index].player_name}`,
|
|
2732
|
+
)
|
|
2589
2733
|
this.playersAway.push({
|
|
2590
2734
|
played: true,
|
|
2591
2735
|
name: data.data.home_team.starting_lineup[0].lineup[index].player_name,
|
|
@@ -2985,6 +3129,7 @@ export default {
|
|
|
2985
3129
|
console.log(
|
|
2986
3130
|
`✅ getLineUpProbablesAway3D: Petición completada exitosamente para game_id: ${game}`,
|
|
2987
3131
|
)
|
|
3132
|
+
console.log(`📊 Jugadores AWAY cargados: ${this.playersAway.length}`)
|
|
2988
3133
|
} catch (e) {
|
|
2989
3134
|
// Remover la petición del estado pendiente en caso de error
|
|
2990
3135
|
this.removeRequestPending(game, 'away')
|
|
@@ -2998,8 +3143,8 @@ export default {
|
|
|
2998
3143
|
console.log('✅ getLineupProbablesHome: Cargando alineaciones para game_id:', val.id)
|
|
2999
3144
|
this.auxProbablesIDGameHome = val.id
|
|
3000
3145
|
//this.homeTeam.acronym = this.awayTeamAbrev
|
|
3001
|
-
this.cleaneDataHome()
|
|
3002
|
-
this.getLineUpProbablesHome3D(val.id)
|
|
3146
|
+
//this.cleaneDataHome()
|
|
3147
|
+
//this.getLineUpProbablesHome3D(val.id)
|
|
3003
3148
|
}
|
|
3004
3149
|
} else {
|
|
3005
3150
|
console.warn('❌ getLineupProbablesHome: game_id inválido:', val?.id)
|
|
@@ -3011,8 +3156,8 @@ export default {
|
|
|
3011
3156
|
console.log('✅ getLineupProbablesAway: Cargando alineaciones para game_id:', val.id)
|
|
3012
3157
|
this.auxProbablesIDGameAway = val.id
|
|
3013
3158
|
//this.visitingTeam.acronym = this.awayTeamAbrev
|
|
3014
|
-
this.cleaneDataAway()
|
|
3015
|
-
this.getLineUpProbablesAway3D(val.id)
|
|
3159
|
+
//this.cleaneDataAway()
|
|
3160
|
+
//this.getLineUpProbablesAway3D(val.id)
|
|
3016
3161
|
}
|
|
3017
3162
|
} else {
|
|
3018
3163
|
console.warn('❌ getLineupProbablesAway: game_id inválido:', val?.id)
|
|
@@ -3083,7 +3228,17 @@ export default {
|
|
|
3083
3228
|
game.game_id +
|
|
3084
3229
|
'/lineups',
|
|
3085
3230
|
))
|
|
3231
|
+
console.log(
|
|
3232
|
+
'GAME INFO HEADER --------------------------------------------------------> ',
|
|
3233
|
+
game.game_id,
|
|
3234
|
+
)
|
|
3086
3235
|
this.gameInfoheader = data.data.game
|
|
3236
|
+
console.log(
|
|
3237
|
+
'📋 gameInfoheader establecido para game_id:',
|
|
3238
|
+
this.gameInfoheader.id,
|
|
3239
|
+
'del partido:',
|
|
3240
|
+
game.game_id,
|
|
3241
|
+
)
|
|
3087
3242
|
if (this.selectedOption != 'Postmatch') {
|
|
3088
3243
|
for (let index = 0; index < data.data.games_historic.length; index++) {
|
|
3089
3244
|
this.gamesHistoric.push({
|
|
@@ -3500,7 +3655,10 @@ export default {
|
|
|
3500
3655
|
console.warn('❌ getLineUp: Se intentó hacer petición con game_id inválido:', game)
|
|
3501
3656
|
return
|
|
3502
3657
|
}
|
|
3503
|
-
|
|
3658
|
+
console.log(
|
|
3659
|
+
'------------------------------------------------> SE HIZO LA PETICION ----> DEL PARTIDO ID: ',
|
|
3660
|
+
game,
|
|
3661
|
+
)
|
|
3504
3662
|
// Verificar si ya hay una petición en curso para este game_id
|
|
3505
3663
|
if (this.isRequestPending(game, 'general')) {
|
|
3506
3664
|
console.warn(`🔒 getLineUp: Ya hay una petición en curso para game_id: ${game}`)
|