@@ -266,16 +266,13 @@ static void write_filename(struct MPContext *mpctx, FILE *file, char *filename)
266
266
}
267
267
}
268
268
269
- static void write_title (struct MPContext * mpctx , FILE * file )
269
+ static void write_title (struct MPContext * mpctx , FILE * file , const char * title )
270
270
{
271
- if (mpctx -> opts -> write_filename_in_watch_later_config ) {
272
- const char * title = mp_find_non_filename_media_title (mpctx );
273
- if (title ) {
274
- char write_title [1024 ] = {0 };
275
- for (int n = 0 ; title [n ] && n < sizeof (write_title ) - 1 ; n ++ )
276
- write_title [n ] = (unsigned char )title [n ] < 32 ? '_' : title [n ];
277
- fprintf (file , "# title: %s\n" , write_title );
278
- }
271
+ if (mpctx -> opts -> write_filename_in_watch_later_config && title ) {
272
+ char write_title [1024 ] = {0 };
273
+ for (int n = 0 ; title [n ] && n < sizeof (write_title ) - 1 ; n ++ )
274
+ write_title [n ] = (unsigned char )title [n ] < 32 ? '_' : title [n ];
275
+ fprintf (file , "# title: %s\n" , write_title );
279
276
}
280
277
}
281
278
@@ -287,6 +284,8 @@ static void write_redirect(struct MPContext *mpctx, char *path)
287
284
if (file ) {
288
285
fprintf (file , "# redirect entry\n" );
289
286
write_filename (mpctx , file , path );
287
+ write_title (mpctx , file ,
288
+ mp_tags_get_str (mpctx -> demuxer -> metadata , "ytdl_playlist_title" ));
290
289
fclose (file );
291
290
}
292
291
@@ -352,7 +351,7 @@ void mp_write_watch_later_conf(struct MPContext *mpctx)
352
351
353
352
write_filename (mpctx , file , path );
354
353
355
- write_title (mpctx , file );
354
+ write_title (mpctx , file , mp_find_non_filename_media_title ( mpctx ) );
356
355
357
356
bool write_start = true;
358
357
double pos = get_playback_time (mpctx );
0 commit comments