You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: download.rs
    path of file: ./repos/anki/rslib/src/sync/media/database/server/entry
    
    the code of the file until where you have to start completion: // Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html

use rusqlite::params;

use crate::error;
use crate::sync::error::HttpResult;
use crate::sync::error::OrHttpErr;
use crate::sync::media::database::server::entry::MediaEntry;
use crate::sync::media::database::server::ServerMediaDatabase;
use crate::sync::media::MAX_MEDIA_FILES_IN_ZIP;
use crate::sync::media::MEDIA_SYNC_TARGET_ZIP_BYTES;

impl ServerMediaDatabase {
    /// Return a list of entries in the same order as the provided f
    
    pub fn get_entries_for_download(&self, files: &[String]) -> HttpResult<Vec<MediaEntry>> {
        if files.len() > MAX_MEDIA_FILES_IN_ZIP {
            None.or_bad_request("too many files requested")?;
        }

        let mut entries = vec![];
        let mut accumulated_size = 0;
        for filename in files {
            let Some(entry) = self
                .get_nonempty_entry(filename)
                .or_internal_err("fetching entry")?
            else {
                return None.or_conflict(format!("missing/empty file entry: {filename}"));
            };

            accumulated_size += entry.size;
            entries.push(entry);
            if accumulated_size > MEDIA_SYNC_TARGET_ZIP_BYTES as u64 {
                break;
            }
        }
        Ok(entries)
    }