Removed locate from DB struct

This commit is contained in:
Antoine Gersant 2017-07-01 12:49:58 -07:00
parent d9532dd22c
commit 6202311aa7
2 changed files with 3 additions and 6 deletions

View file

@ -20,6 +20,7 @@ use errors::*;
use thumbnails::*;
use user;
use utils::*;
use vfs::VFSSource;
const CURRENT_MAJOR_VERSION: i32 = 2;
const CURRENT_MINOR_VERSION: i32 = 0;
@ -265,7 +266,8 @@ fn serve(request: &mut Request, db: &DB) -> IronResult<Response> {
Ok(p) => p,
};
let real_path = db.locate(virtual_path.as_path());
let vfs = db.get_vfs()?;
let real_path = vfs.virtual_to_real(&virtual_path);
let real_path = match real_path {
Err(e) => return Err(IronError::new(e, status::NotFound)),
Ok(p) => p,

View file

@ -114,11 +114,6 @@ impl DB {
Ok(misc.auth_secret.to_owned())
}
pub fn locate(&self, virtual_path: &Path) -> Result<PathBuf> {
let vfs = self.get_vfs()?;
vfs.virtual_to_real(virtual_path)
}
pub fn index_update(&self) -> Result<()> {
index::update(self)
}