@@ -181,15 +181,15 @@ fn get_chapter_titles(doc: &mut EpubDoc<BufReader<File>>) -> Vec<String> {
181
181
let spine = doc. spine . clone ( ) ;
182
182
183
183
for ( i, current_section) in spine. iter ( ) . enumerate ( ) {
184
- let path = doc. resources . get ( current_section) . unwrap ( ) . 0 . clone ( ) ;
184
+ let path = doc. resources . get ( & current_section. idref ) . unwrap ( ) . 0 . clone ( ) ;
185
185
let text = doc. get_resource_by_path ( & path) . unwrap ( ) ;
186
186
let html = str:: from_utf8 ( & text) . unwrap ( ) ;
187
187
let chapter_number = i + 1 ;
188
188
189
189
let path_string: String = path. to_string_lossy ( ) . into ( ) ;
190
190
println ! (
191
191
"Processing chapter {}/{}: Section Name: {} Path: {}" ,
192
- chapter_number, number_of_ids, current_section, path_string,
192
+ chapter_number, number_of_ids, current_section. idref , path_string,
193
193
) ;
194
194
195
195
// Find matching TOC entries, otherwise push an empty string
@@ -252,7 +252,7 @@ fn convert_book(
252
252
let spine = doc. spine . clone ( ) ;
253
253
254
254
for ( i, current_section) in spine. iter ( ) . enumerate ( ) {
255
- let path = doc. resources . get ( current_section) . unwrap ( ) . 0 . clone ( ) ;
255
+ let path = doc. resources . get ( & current_section. idref ) . unwrap ( ) . 0 . clone ( ) ;
256
256
let text = doc. get_resource_by_path ( & path) . unwrap ( ) ;
257
257
let html = str:: from_utf8 ( & text) . unwrap ( ) ;
258
258
let chapter_number = i + 1 ;
@@ -261,7 +261,7 @@ fn convert_book(
261
261
let title_to_use = if title. len ( ) > 2 {
262
262
title
263
263
} else {
264
- current_section
264
+ & current_section. idref
265
265
} ;
266
266
267
267
let filename = if title. len ( ) > 2 {
@@ -270,13 +270,13 @@ fn convert_book(
270
270
format ! (
271
271
"{:04}_{}" ,
272
272
chapter_number,
273
- sanitize_filename( current_section)
273
+ sanitize_filename( & current_section. idref )
274
274
)
275
275
} ;
276
276
277
277
println ! (
278
278
"Converting Chapter {:>3}/{}: {:<21} Title Source: TOC Filename: {}" ,
279
- chapter_number, number_of_ids, current_section, filename
279
+ chapter_number, number_of_ids, & current_section. idref , filename
280
280
) ;
281
281
282
282
output_to_file (
0 commit comments