File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -387,10 +387,6 @@ pub async fn handle_player_data(params: PlayerDataParams) -> Result<()> {
387387 ) ;
388388 }
389389
390- // Cache the filtered results for future use (only when not using cached data)
391- if !use_cached {
392- db. cache_filtered_player_data ( & player_points, & params. base , params. projected ) ;
393- }
394390
395391 // Sort descending by points
396392 player_points. sort_by ( |a, b| {
Original file line number Diff line number Diff line change @@ -359,47 +359,6 @@ impl PlayerDatabase {
359359 Ok ( results)
360360 }
361361
362- /// Cache filtered player data results (used after client-side filtering)
363- pub fn cache_filtered_player_data (
364- & self ,
365- results : & [ crate :: espn:: types:: PlayerPoints ] ,
366- params : & CommandParams ,
367- projected : bool ,
368- ) {
369- // Create cache key
370- let cache_key = PlayerDataCacheKey {
371- season : params. season ,
372- week : params. week ,
373- player_names : params. player_names . clone ( ) ,
374- positions : params. positions . clone ( ) ,
375- projected,
376- injury_status : params. injury_status . clone ( ) ,
377- roster_status : params. roster_status . clone ( ) ,
378- fantasy_team_filter : params. fantasy_team_filter . clone ( ) ,
379- } ;
380-
381- // Convert PlayerPoints to CachedPlayerDataRow format
382- let cached_data: Vec < CachedPlayerDataRow > = results
383- . iter ( )
384- . map ( |player| {
385- (
386- player. id ,
387- player. name . clone ( ) ,
388- player. position . clone ( ) ,
389- player. points ,
390- player. active ,
391- player. injured ,
392- player. injury_status . clone ( ) ,
393- player. is_rostered ,
394- player. team_id ,
395- player. team_name . clone ( ) ,
396- )
397- } )
398- . collect ( ) ;
399-
400- // Cache the results
401- GLOBAL_CACHE . player_data . put ( cache_key, cached_data) ;
402- }
403362
404363 /// Check if we already have data for a specific season/week combination
405364 /// Returns true if any player data exists for the given filters
You can’t perform that action at this time.
0 commit comments