MCPcopy Create free account
hub / github.com/codestation/qcma / checkFileType

Method checkFileType

common/database.cpp:86–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86int Database::checkFileType(const QString path, int ohfi_root)
87{
88 switch(ohfi_root) {
89 case VITA_OHFI_MUSIC:
90 for(int i = 0, max = sizeof(audio_list) / sizeof(file_type); i < max; i++) {
91 if(path.endsWith(audio_list[i].file_ext, Qt::CaseInsensitive)) {
92 return i;
93 }
94 }
95 break;
96 case VITA_OHFI_PHOTO:
97 for(int i = 0, max = sizeof(photo_list) / sizeof(file_type); i< max; i++) {
98 if(path.endsWith(photo_list[i].file_ext, Qt::CaseInsensitive)) {
99 return i;
100 }
101 }
102 break;
103 case VITA_OHFI_VIDEO:
104 for(int i = 0, max = sizeof(video_list) / sizeof(file_type); i< max; i++) {
105 if(path.endsWith(video_list[i].file_ext, Qt::CaseInsensitive)) {
106 return i;
107 }
108 }
109 break;
110 default:
111 return 0;
112 }
113 return -1;
114}
115
116void Database::loadMusicMetadata(const QString &path, metadata_t &metadata)
117{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected