mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
parent
a5b2c3d53f
commit
8ca5351872
@ -94,7 +94,8 @@ namespace Orchard.MediaLibrary.Services {
|
||||
|
||||
if (!String.IsNullOrEmpty(folderPath)) {
|
||||
if (recursive) {
|
||||
query = query.Join<MediaPartRecord>().Where(m => m.FolderPath.StartsWith(folderPath));
|
||||
var subfolderSearch = folderPath.EndsWith(Path.DirectorySeparatorChar.ToString()) ? folderPath : folderPath + Path.DirectorySeparatorChar;
|
||||
query = query.Join<MediaPartRecord>().Where(m => (m.FolderPath == folderPath || m.FolderPath.StartsWith(subfolderSearch)));
|
||||
}
|
||||
else {
|
||||
query = query.Join<MediaPartRecord>().Where(m => m.FolderPath == folderPath);
|
||||
|
Loading…
Reference in New Issue
Block a user