mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
committed by
Sébastien Ros
parent
906ee6fe0c
commit
4d04dcc5bb
@@ -40,8 +40,15 @@ namespace Orchard.MediaLibrary.Handlers {
|
||||
|
||||
OnRemoving<MediaPart>((context, part) => RemoveMedia(part));
|
||||
OnLoaded<MediaPart>((context, part) => {
|
||||
if (!String.IsNullOrEmpty(part.FileName)) {
|
||||
if (!string.IsNullOrEmpty(part.FileName)) {
|
||||
part._publicUrl.Loader(() => _mediaLibraryService.GetMediaPublicUrl(part.FolderPath, part.FileName));
|
||||
} else {
|
||||
// Usually, OEmbedParts won't directly have a source file, but we may be interested
|
||||
// in easily accessing their source Url.
|
||||
var oePart = part.As<OEmbedPart>();
|
||||
if (oePart != null) {
|
||||
part._publicUrl.Loader(() => oePart.Source);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user