Add FILE_PATH_7Z_EXTENSION/FILE_PATH_ZIP_EXTENSION

This commit is contained in:
twinaphex 2016-07-01 05:53:55 +02:00
parent a38675a562
commit 13cadc6c1d
3 changed files with 10 additions and 4 deletions

View File

@ -61,6 +61,8 @@ enum file_path_enum
FILE_PATH_CHT_EXTENSION,
FILE_PATH_LPL_EXTENSION,
FILE_PATH_RDB_EXTENSION,
FILE_PATH_ZIP_EXTENSION,
FILE_PATH_7Z_EXTENSION,
FILE_PATH_CONFIG_EXTENSION,
FILE_PATH_CORE_INFO_EXTENSION
};

View File

@ -63,6 +63,10 @@ const char *file_path_str(enum file_path_enum enum_idx)
return ".bps";
case FILE_PATH_RDB_EXTENSION:
return ".rdb";
case FILE_PATH_ZIP_EXTENSION:
return ".zip";
case FILE_PATH_7Z_EXTENSION:
return ".7z";
case FILE_PATH_INDEX_URL:
return ".index";
case FILE_PATH_INDEX_DIRS_URL:

View File

@ -68,10 +68,10 @@ bool menu_content_load_from_playlist(menu_content_ctx_playlist_info_t *info)
for (i = 0; i < strlen(path_tolower); ++i)
path_tolower[i] = tolower(path_tolower[i]);
if (strstr(path_tolower, ".zip"))
strstr(path_tolower, ".zip")[4] = '\0';
else if (strstr(path_tolower, ".7z"))
strstr(path_tolower, ".7z")[3] = '\0';
if (strstr(path_tolower, file_path_str(FILE_PATH_ZIP_EXTENSION)))
strstr(path_tolower, file_path_str(FILE_PATH_ZIP_EXTENSION))[4] = '\0';
else if (strstr(path_tolower, file_path_str(FILE_PATH_7Z_EXTENSION)))
strstr(path_tolower, file_path_str(FILE_PATH_7Z_EXTENSION))[3] = '\0';
path_check = (char *)
calloc(strlen(path_tolower) + 1, sizeof(char));