File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,27 +200,17 @@ private function getNameFromNode($node) {
200200 */
201201 private function getStorageIdFromNode ($ node ) {
202202 $ storageId = $ node ->getStorage ()->getId ();
203- $ query = $ this ->connection ->getQueryBuilder ();
204- $ query ->select ('numeric_id ' )
205- ->from ('storages ' )
206- ->where ($ query ->expr ()->eq ('id ' , $ query ->createNamedParameter ($ storageId )));
207- $ result = $ query ->executeQuery ();
208-
209- if ($ result ->rowCount () > 1 ) {
210- throw new \OCP \DB \Exception ("Storage (' $ storageId') is not unique in database! " );
211- }
212-
213- $ numericId = $ result ->fetchOne ();
214- if ($ numericId === false ) {
215- throw new \OCP \DB \Exception ("Unable to find storage ' $ storageId' in database! " );
203+ if ($ numericStorageId = \OC \Files \Cache \Storage::getNumericStorageId ($ storageId )) {
204+ return $ numericStorageId ;
205+ } else {
206+ throw new \OCP \Files \StorageNotAvailableException ("Unable to find storage ' $ storageId'! " );
216207 }
217- return $ numericId ;
218208 }
219209
220210 /**
221211 * @param \OCP\Files\FileInfo $node
222212 */
223213 private function getPathFromNode ($ node ) {
224- return $ node ->getPath ();
214+ return $ node ->getInternalPath ();
225215 }
226216}
You can’t perform that action at this time.
0 commit comments