mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-11 19:33:30 -07:00
Support remote and playlist files in archive
This commit is contained in:
@@ -27,6 +27,9 @@ static const char* known_ext[] = {
|
||||
[ArchiveFileTypeSubGhz] = ".sub",
|
||||
[ArchiveFileTypeLFRFID] = ".rfid",
|
||||
[ArchiveFileTypeInfrared] = ".ir",
|
||||
[ArchiveFileTypeSubghzPlaylist] = ".txt",
|
||||
[ArchiveFileTypeSubghzRemote] = ".txt",
|
||||
[ArchiveFileTypeInfraredRemote] = ".txt",
|
||||
[ArchiveFileTypeBadKb] = ".txt",
|
||||
[ArchiveFileTypeU2f] = "?",
|
||||
[ArchiveFileTypeApplication] = ".fap",
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "archive_files.h"
|
||||
#include "archive_apps.h"
|
||||
#include "archive_browser.h"
|
||||
#include <applications/external/subghz_playlist/playlist_file.h>
|
||||
#include <applications/external/subghz_remote/subghz_remote_app_i.h>
|
||||
#include <applications/external/ir_remote/infrared_remote.h>
|
||||
|
||||
#define TAG "Archive"
|
||||
|
||||
@@ -16,11 +19,26 @@ void archive_set_file_type(ArchiveFile_t* file, const char* path, bool is_folder
|
||||
for(size_t i = 0; i < COUNT_OF(known_ext); i++) {
|
||||
if((known_ext[i][0] == '?') || (known_ext[i][0] == '*')) continue;
|
||||
if(furi_string_search(file->path, known_ext[i], 0) != FURI_STRING_FAILURE) {
|
||||
if(i == ArchiveFileTypeBadKb) {
|
||||
if(furi_string_search(file->path, archive_get_default_path(ArchiveTabBadKb)) ==
|
||||
0) {
|
||||
// Check for .txt containing folder
|
||||
if(strcmp(known_ext[i], ".txt") == 0) {
|
||||
const char* path = NULL;
|
||||
switch(i) {
|
||||
case ArchiveFileTypeSubghzPlaylist:
|
||||
path = PLAYLIST_FOLDER;
|
||||
break;
|
||||
case ArchiveFileTypeSubghzRemote:
|
||||
path = SUBREM_APP_FOLDER;
|
||||
break;
|
||||
case ArchiveFileTypeInfraredRemote:
|
||||
path = IR_REMOTE_PATH;
|
||||
break;
|
||||
case ArchiveFileTypeBadKb:
|
||||
path = archive_get_default_path(ArchiveTabBadKb);
|
||||
break;
|
||||
}
|
||||
if(path != NULL && furi_string_search(file->path, path) == 0) {
|
||||
file->type = i;
|
||||
return; // *.txt file is a BadKB script only if it is in BadKB folder
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
file->type = i;
|
||||
|
||||
@@ -15,6 +15,9 @@ typedef enum {
|
||||
ArchiveFileTypeSubGhz,
|
||||
ArchiveFileTypeLFRFID,
|
||||
ArchiveFileTypeInfrared,
|
||||
ArchiveFileTypeSubghzPlaylist,
|
||||
ArchiveFileTypeSubghzRemote,
|
||||
ArchiveFileTypeInfraredRemote,
|
||||
ArchiveFileTypeBadKb,
|
||||
ArchiveFileTypeU2f,
|
||||
ArchiveFileTypeApplication,
|
||||
|
||||
@@ -23,6 +23,12 @@ const char* archive_get_flipper_app_name(ArchiveFileTypeEnum file_type) {
|
||||
return "RFID";
|
||||
case ArchiveFileTypeInfrared:
|
||||
return "Infrared";
|
||||
case ArchiveFileTypeSubghzPlaylist:
|
||||
return EXT_PATH("apps/Sub-Ghz/subghz_playlist.fap");
|
||||
case ArchiveFileTypeSubghzRemote:
|
||||
return EXT_PATH("apps/Sub-Ghz/subghz_remote.fap");
|
||||
case ArchiveFileTypeInfraredRemote:
|
||||
return EXT_PATH("apps/Tools/ir_remote.fap");
|
||||
case ArchiveFileTypeBadKb:
|
||||
return "Bad KB";
|
||||
case ArchiveFileTypeU2f:
|
||||
|
||||
@@ -29,6 +29,9 @@ static const Icon* ArchiveItemIcons[] = {
|
||||
[ArchiveFileTypeSubGhz] = &I_sub1_10px,
|
||||
[ArchiveFileTypeLFRFID] = &I_125_10px,
|
||||
[ArchiveFileTypeInfrared] = &I_ir_10px,
|
||||
[ArchiveFileTypeSubghzPlaylist] = &I_subplaylist_10px,
|
||||
[ArchiveFileTypeSubghzRemote] = &I_subrem_10px,
|
||||
[ArchiveFileTypeInfraredRemote] = &I_ir_scope_10px,
|
||||
[ArchiveFileTypeBadKb] = &I_badkb_10px,
|
||||
[ArchiveFileTypeU2f] = &I_u2f_10px,
|
||||
[ArchiveFileTypeApplication] = &I_Apps_10px,
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 169 B |
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
@@ -3456,6 +3456,7 @@ Variable,+,I_iButtonDolphinVerySuccess_108x52,Icon,
|
||||
Variable,+,I_iButtonKey_49x44,Icon,
|
||||
Variable,+,I_ibutt_10px,Icon,
|
||||
Variable,+,I_ir_10px,Icon,
|
||||
Variable,+,I_ir_scope_10px,Icon,
|
||||
Variable,+,I_keyboard_10px,Icon,
|
||||
Variable,+,I_loading_10px,Icon,
|
||||
Variable,+,I_music_10px,Icon,
|
||||
@@ -3464,6 +3465,7 @@ Variable,+,I_passport_bad_46x49,Icon,
|
||||
Variable,+,I_passport_happy_46x49,Icon,
|
||||
Variable,+,I_passport_okay_46x49,Icon,
|
||||
Variable,+,I_sub1_10px,Icon,
|
||||
Variable,+,I_subplaylist_10px,Icon,
|
||||
Variable,+,I_subrem_10px,Icon,
|
||||
Variable,+,I_u2f_10px,Icon,
|
||||
Variable,+,I_unknown_10px,Icon,
|
||||
|
||||
|
Reference in New Issue
Block a user