diff --git a/filesel/filesystem.h b/filesel/filesystem.h index 5833d854..f7717964 100644 --- a/filesel/filesystem.h +++ b/filesel/filesystem.h @@ -22,10 +22,15 @@ typedef void *ocpdirhandle_pt; #define COMPRESSION_SOLID2 5 /* ... */ #define COMPRESSION_SOLID3 6 /* ... */ #define COMPRESSION_SOLID4 7 /* ... */ +#define COMPRESSION_REMOTE 127 static inline uint8_t COMPRESSION_ADD_STORE (uint8_t parent) { uint8_t retval = (parent >= COMPRESSION_STREAM) ? parent+1 : parent | 1; + if (parent == COMPRESSION_REMOTE) + { + return COMPRESSION_REMOTE; + } if (retval > COMPRESSION_SOLID4) { retval = COMPRESSION_SOLID4; @@ -35,6 +40,10 @@ static inline uint8_t COMPRESSION_ADD_STORE (uint8_t parent) static inline uint8_t COMPRESSION_ADD_STREAM (uint8_t parent) { uint8_t retval = parent + 2; + if (parent == COMPRESSION_REMOTE) + { + return COMPRESSION_REMOTE; + } if (retval > COMPRESSION_SOLID4) { retval = COMPRESSION_SOLID4; @@ -44,6 +53,10 @@ static inline uint8_t COMPRESSION_ADD_STREAM (uint8_t parent) static inline uint8_t COMPRESSION_ADD_SOLID (uint8_t parent) { uint8_t retval = parent + 3; + if (parent == COMPRESSION_REMOTE) + { + return COMPRESSION_REMOTE; + } if (retval > COMPRESSION_SOLID4) { retval = COMPRESSION_SOLID4; diff --git a/filesel/pfilesel.c b/filesel/pfilesel.c index 4729e474..3c887fc7 100644 --- a/filesel/pfilesel.c +++ b/filesel/pfilesel.c @@ -284,7 +284,7 @@ static void fsReadDir_file (void *_token, struct ocpfile_t *file) if (ismod || // always include if file is an actual module (fsShowAllFiles && (!(token->opt & RD_ISMODONLY)))) // force include if fsShowAllFiles is true, except if RD_ISMODONLY { - modlist_append_file (token->ml, file, ismod, file->compression >= COMPRESSION_SOLID); /* modlist_append() will do refcount on the file */ + modlist_append_file (token->ml, file, ismod, file->compression >= COMPRESSION_SOLID && (file->compression < COMPRESSION_REMOTE)); /* modlist_append() will do refcount on the file */ } out: free (curext); @@ -3297,7 +3297,7 @@ signed int fsFileSelect(void) if (!Console.KeyboardHit() && fsScanNames) { int poll = 1; - if ((m->file && (m->flags & MODLIST_FLAG_ISMOD)) && (!mdbInfoIsAvailable(m->mdb_ref)) && (!(m->flags&MODLIST_FLAG_SCANNED))) + if ((m->file && (m->file->compression < COMPRESSION_REMOTE) && (m->flags & MODLIST_FLAG_ISMOD)) && (!mdbInfoIsAvailable(m->mdb_ref)) && (!(m->flags&MODLIST_FLAG_SCANNED))) { mdbScan(m->file, m->mdb_ref); m->flags |= MODLIST_FLAG_SCANNED; @@ -3308,7 +3308,7 @@ signed int fsFileSelect(void) struct modlistentry *scanm; if ((scanm=modlist_get(currentdir, scanposf++))) { - if (scanm->file && (scanm->flags & MODLIST_FLAG_ISMOD) && (!(scanm->flags & MODLIST_FLAG_SCANNED))) + if (scanm->file && (scanm->file->compression < COMPRESSION_REMOTE) && (scanm->flags & MODLIST_FLAG_ISMOD) && (!(scanm->flags & MODLIST_FLAG_SCANNED))) { if (!mdbInfoIsAvailable(scanm->mdb_ref)) { @@ -3329,7 +3329,7 @@ signed int fsFileSelect(void) struct modlistentry *scanm; if ((scanm=modlist_get(playlist, scanposp++))) { - if (scanm->file && (scanm->flags & MODLIST_FLAG_ISMOD)) + if (scanm->file && (scanm->file->compression < COMPRESSION_REMOTE) && (scanm->flags & MODLIST_FLAG_ISMOD)) { if (!mdbInfoIsAvailable(scanm->mdb_ref)) { @@ -3470,7 +3470,8 @@ signed int fsFileSelect(void) mdbEditBuf.modtype.integer.i = mtUnRead; if (!mdbWriteModuleInfo(m->mdb_ref, &mdbEditBuf)) return -1; - m->flags &= ~MODLIST_FLAG_SCANNED; + mdbScan(m->file, m->mdb_ref); + m->flags |= MODLIST_FLAG_SCANNED; } break; case KEY_CTRL_BS: @@ -3535,6 +3536,12 @@ signed int fsFileSelect(void) break; } } + /* We delay mdbScan for remote files until this stage */ + if (m && m->file && (m->file->compression >= COMPRESSION_REMOTE) && !(m->flags & MODLIST_FLAG_SCANNED)) + { + mdbScan (m->file, m->mdb_ref); + m->flags |= MODLIST_FLAG_SCANNED; + } if (win) { if (!playlist->num)