@@ -25,8 +25,12 @@ pub struct NavigationDataStatus {
2525 pub status : InstallStatus ,
2626 #[ serde( rename = "installedFormat" ) ]
2727 pub installed_format : Option < String > ,
28+ #[ serde( rename = "installedRevision" ) ]
29+ pub installed_revision : Option < String > ,
2830 #[ serde( rename = "installedCycle" ) ]
2931 pub installed_cycle : Option < String > ,
32+ #[ serde( rename = "validityPeriod" ) ]
33+ pub validity_period : Option < String > ,
3034 #[ serde( rename = "latestCycle" ) ]
3135 pub latest_cycle : String ,
3236}
@@ -45,6 +49,8 @@ pub struct InstalledNavigationDataCycleInfo {
4549 pub revision : String ,
4650 pub name : String ,
4751 pub format : String ,
52+ #[ serde( rename = "validityPeriod" ) ]
53+ pub validity_period : String ,
4854}
4955
5056pub fn start_network_request ( task : Rc < RefCell < Task > > ) {
@@ -102,13 +108,17 @@ pub fn get_navigation_data_install_status(task: Rc<RefCell<Task>>) {
102108 InstallStatus :: None
103109 } ;
104110
111+ println ! ( "opening json" ) ;
112+
105113 // Open JSON
106114 let json_path = match status {
107115 InstallStatus :: Manual => Some ( PathBuf :: from ( consts:: NAVIGATION_DATA_DOWNLOADED_LOCATION ) . join ( "cycle.json" ) ) ,
108116 InstallStatus :: Bundled => Some ( PathBuf :: from ( consts:: NAVIGATION_DATA_DEFAULT_LOCATION ) . join ( "cycle.json" ) ) ,
109117 InstallStatus :: None => None ,
110118 } ;
111119
120+ println ! ( "json_path: {:#?}" , json_path) ;
121+
112122 let installed_cycle_info = match json_path {
113123 Some ( json_path) => {
114124 let json_file = match std:: fs:: File :: open ( json_path) {
@@ -138,10 +148,18 @@ pub fn get_navigation_data_install_status(task: Rc<RefCell<Task>>) {
138148 Some ( installed_cycle_info) => Some ( installed_cycle_info. format . clone ( ) ) ,
139149 None => None ,
140150 } ,
151+ installed_revision : match & installed_cycle_info {
152+ Some ( installed_cycle_info) => Some ( installed_cycle_info. revision . clone ( ) ) ,
153+ None => None ,
154+ } ,
141155 installed_cycle : match & installed_cycle_info {
142156 Some ( installed_cycle_info) => Some ( installed_cycle_info. cycle . clone ( ) ) ,
143157 None => None ,
144158 } ,
159+ validity_period : match & installed_cycle_info {
160+ Some ( installed_cycle_info) => Some ( installed_cycle_info. validity_period . clone ( ) ) ,
161+ None => None ,
162+ } ,
145163 latest_cycle : response_struct. cycle ,
146164 } ;
147165
0 commit comments