Skip to content

Commit ca850d0

Browse files
Merge pull request #17798 from warmenhoven/warmenhoven/pr/ios-man-scan
iOS: fix rescanning manual playlists after app update
2 parents 5702908 + 7998511 commit ca850d0

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

manual_content_scan.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ bool manual_content_scan_set_menu_content_dir(const char *content_dir)
284284
size_t _len;
285285
const char *dir_name = NULL;
286286

287+
char _tmpbuf[PATH_MAX_LENGTH];
288+
fill_pathname_expand_special(_tmpbuf, content_dir, sizeof(_tmpbuf));
289+
content_dir = _tmpbuf;
290+
287291
/* Sanity check */
288292
if (string_is_empty(content_dir))
289293
goto error;
@@ -669,7 +673,7 @@ enum manual_content_scan_playlist_refresh_status
669673
scan_settings.dat_file_path[0] = '\0';
670674
else
671675
{
672-
strlcpy(scan_settings.dat_file_path, dat_file_path,
676+
fill_pathname_expand_special(scan_settings.dat_file_path, dat_file_path,
673677
sizeof(scan_settings.dat_file_path));
674678

675679
switch (manual_content_scan_validate_dat_file_path())

playlist.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,13 @@ size_t playlist_config_set_base_content_directory(
158158
{
159159
config->autofix_paths = !string_is_empty(path);
160160
if (config->autofix_paths)
161+
#if IOS
162+
return fill_path_abbreviate_special(config->base_content_directory, path,
163+
sizeof(config->base_content_directory));
164+
#else
161165
return strlcpy(config->base_content_directory, path,
162166
sizeof(config->base_content_directory));
167+
#endif
163168
config->base_content_directory[0] = '\0';
164169
}
165170
return 0;
@@ -1139,7 +1144,7 @@ enum playlist_thumbnail_name_flags playlist_get_next_thumbnail_name_flag(playlis
11391144
void playlist_resolve_path(enum playlist_file_mode mode,
11401145
bool is_core, char *s, size_t len)
11411146
{
1142-
#ifdef HAVE_COCOATOUCH
1147+
#if IOS
11431148
char tmp[PATH_MAX_LENGTH];
11441149
int _len = 0;
11451150

@@ -3510,6 +3515,11 @@ void playlist_set_scan_content_dir(playlist_t *playlist, const char *content_dir
35103515
{
35113516
bool current_string_empty;
35123517
bool new_string_empty;
3518+
#if IOS
3519+
char _tmpbuf[PATH_MAX_LENGTH];
3520+
fill_pathname_abbreviate_special(_tmpbuf, content_dir, sizeof(_tmpbuf));
3521+
content_dir = _tmpbuf;
3522+
#endif
35133523

35143524
if (!playlist)
35153525
return;
@@ -3572,6 +3582,11 @@ void playlist_set_scan_dat_file_path(playlist_t *playlist, const char *dat_file_
35723582
{
35733583
bool current_string_empty;
35743584
bool new_string_empty;
3585+
#if IOS
3586+
char _tmpbuf[PATH_MAX_LENGTH];
3587+
fill_pathname_abbreviate_special(_tmpbuf, dat_file_path, sizeof(_tmpbuf));
3588+
dat_file_path = _tmpbuf;
3589+
#endif
35753590

35763591
if (!playlist)
35773592
return;

0 commit comments

Comments
 (0)