diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/AssetService/AssetService.cs | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index e7eb6fe..08fd3f8 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs | |||
@@ -123,46 +123,32 @@ namespace OpenSim.Services.AssetService | |||
123 | public virtual AssetMetadata GetMetadata(string id) | 123 | public virtual AssetMetadata GetMetadata(string id) |
124 | { | 124 | { |
125 | // m_log.DebugFormat("[ASSET SERVICE]: Get asset metadata for {0}", id); | 125 | // m_log.DebugFormat("[ASSET SERVICE]: Get asset metadata for {0}", id); |
126 | |||
127 | UUID assetID; | ||
128 | 126 | ||
129 | if (!UUID.TryParse(id, out assetID)) | 127 | AssetBase asset = Get(id); |
130 | return null; | ||
131 | 128 | ||
132 | AssetBase asset = m_Database.GetAsset(assetID); | ||
133 | if (asset != null) | 129 | if (asset != null) |
134 | return asset.Metadata; | 130 | return asset.Metadata; |
135 | 131 | else | |
136 | return null; | 132 | return null; |
137 | } | 133 | } |
138 | 134 | ||
139 | public virtual byte[] GetData(string id) | 135 | public virtual byte[] GetData(string id) |
140 | { | 136 | { |
141 | // m_log.DebugFormat("[ASSET SERVICE]: Get asset data for {0}", id); | 137 | // m_log.DebugFormat("[ASSET SERVICE]: Get asset data for {0}", id); |
142 | |||
143 | UUID assetID; | ||
144 | 138 | ||
145 | if (!UUID.TryParse(id, out assetID)) | 139 | AssetBase asset = Get(id); |
146 | return null; | ||
147 | 140 | ||
148 | AssetBase asset = m_Database.GetAsset(assetID); | 141 | if (asset != null) |
149 | return asset.Data; | 142 | return asset.Data; |
143 | else | ||
144 | return null; | ||
150 | } | 145 | } |
151 | 146 | ||
152 | public virtual bool Get(string id, Object sender, AssetRetrieved handler) | 147 | public virtual bool Get(string id, Object sender, AssetRetrieved handler) |
153 | { | 148 | { |
154 | //m_log.DebugFormat("[AssetService]: Get asset async {0}", id); | 149 | //m_log.DebugFormat("[AssetService]: Get asset async {0}", id); |
155 | |||
156 | UUID assetID; | ||
157 | 150 | ||
158 | if (!UUID.TryParse(id, out assetID)) | 151 | handler(id, sender, Get(id)); |
159 | return false; | ||
160 | |||
161 | AssetBase asset = m_Database.GetAsset(assetID); | ||
162 | |||
163 | //m_log.DebugFormat("[AssetService]: Got asset {0}", asset); | ||
164 | |||
165 | handler(id, sender, asset); | ||
166 | 152 | ||
167 | return true; | 153 | return true; |
168 | } | 154 | } |