@@ -785,53 +785,49 @@ require([
785785
786786 let series = [ ] ;
787787 if ( download_type !== "series" ) {
788- if ( parseInt ( clicked . attr ( 'data-total-series' ) ) > 65000 ) {
789-
790- } else {
791- let response = null ;
792- if ( [ "cohort" , "cart" ] . includes ( download_type ) ) {
793- downloader_manager . pendingFetchMessage ( download_type ) ;
794- let filter_and_cart = { } ;
795- if ( download_type === "cohort" ) {
796- let filtergrp_list = [ ] ;
797- for ( const [ attr , vals ] of Object . entries ( filterutils . parseFilterObj ( ) ) ) {
798- filtergrp_list . push ( { [ attr ] : vals } ) ;
799- }
800- filter_and_cart [ "filtergrp_list" ] = filtergrp_list ;
801- } else {
802- window . updatePartitionsFromScratch ( ) ;
803- let ret = cartutils . formcartdata ( ) ;
804- window . partitions = ret [ 0 ] ;
805- window . filtergrp_lst = ret [ 1 ] ;
806- let filterSets = [ ] ;
807- for ( let i = 0 ; i < window . cartHist . length ; i ++ ) {
808- filterSets . push ( window . cartHist [ i ] [ 'filter' ] ) ;
809- }
810- filter_and_cart [ 'partitions' ] = window . partitions ;
811- filter_and_cart [ 'filtergrp_list' ] = filterSets ;
788+ let response = null ;
789+ if ( [ "cohort" , "cart" ] . includes ( download_type ) ) {
790+ downloader_manager . pendingFetchMessage ( download_type ) ;
791+ let filter_and_cart = { } ;
792+ if ( download_type === "cohort" ) {
793+ let filtergrp_list = [ ] ;
794+ for ( const [ attr , vals ] of Object . entries ( filterutils . parseFilterObj ( ) ) ) {
795+ filtergrp_list . push ( { [ attr ] : vals } ) ;
812796 }
813- response = await fetch ( `${ BASE_URL } ${ SERIES_IDS_FILTER_URL } ` , {
814- method : "POST" ,
815- body : JSON . stringify ( filter_and_cart ) ,
816- headers : {
817- "X-CSRFToken" : csrftoken ,
818- "content-type" : "application/json"
819- }
820- } ) ;
797+ filter_and_cart [ "filtergrp_list" ] = filtergrp_list ;
821798 } else {
822- let study_uri = ( study_id !== undefined && study_id !== null ) ? `${ study_id } /` : "" ;
823- let patient_uri = ( patient_id !== undefined && patient_id !== null ) ? `${ patient_id } /` : "" ;
824- response = await fetch ( `${ BASE_URL } ${ SERIES_IDS_URL } ${ collection_id } /${ patient_uri } ${ study_uri } ` ) ;
825- }
826- if ( ! response . ok ) {
827- console . error ( `[ERROR] Failed to retrieve series IDs: ${ response . status } ` ) ;
828- return ;
829- }
830- const series_data = await response . json ( ) ;
831- series . push ( ...series_data [ 'result' ] ) ;
832- if ( 'download_stats' in series_data ) {
833- downloader_manager . set_download_stats ( series_data [ 'download_stats' ] ) ;
799+ window . updatePartitionsFromScratch ( ) ;
800+ let ret = cartutils . formcartdata ( ) ;
801+ window . partitions = ret [ 0 ] ;
802+ window . filtergrp_lst = ret [ 1 ] ;
803+ let filterSets = [ ] ;
804+ for ( let i = 0 ; i < window . cartHist . length ; i ++ ) {
805+ filterSets . push ( window . cartHist [ i ] [ 'filter' ] ) ;
806+ }
807+ filter_and_cart [ 'partitions' ] = window . partitions ;
808+ filter_and_cart [ 'filtergrp_list' ] = filterSets ;
834809 }
810+ response = await fetch ( `${ BASE_URL } ${ SERIES_IDS_FILTER_URL } ` , {
811+ method : "POST" ,
812+ body : JSON . stringify ( filter_and_cart ) ,
813+ headers : {
814+ "X-CSRFToken" : csrftoken ,
815+ "content-type" : "application/json"
816+ }
817+ } ) ;
818+ } else {
819+ let study_uri = ( study_id !== undefined && study_id !== null ) ? `${ study_id } /` : "" ;
820+ let patient_uri = ( patient_id !== undefined && patient_id !== null ) ? `${ patient_id } /` : "" ;
821+ response = await fetch ( `${ BASE_URL } ${ SERIES_IDS_URL } ${ collection_id } /${ patient_uri } ${ study_uri } ` ) ;
822+ }
823+ if ( ! response . ok ) {
824+ console . error ( `[ERROR] Failed to retrieve series IDs: ${ response . status } ` ) ;
825+ return ;
826+ }
827+ const series_data = await response . json ( ) ;
828+ series . push ( ...series_data [ 'result' ] ) ;
829+ if ( 'download_stats' in series_data ) {
830+ downloader_manager . set_download_stats ( series_data [ 'download_stats' ] ) ;
835831 }
836832 } else {
837833 series . push ( {
0 commit comments