mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-20 01:08:55 +00:00
osu: Fix cache
This commit is contained in:
parent
2ad04b34c9
commit
26074ae257
1 changed files with 6 additions and 9 deletions
|
@ -1,17 +1,14 @@
|
||||||
use super::db::OsuLastBeatmap;
|
use super::db::OsuLastBeatmap;
|
||||||
use super::BeatmapWithMode;
|
use super::BeatmapWithMode;
|
||||||
use serenity::{
|
use serenity::model::id::ChannelId;
|
||||||
framework::standard::{CommandError as Error, CommandResult},
|
use youmubot_prelude::*;
|
||||||
model::id::ChannelId,
|
|
||||||
prelude::*,
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Save the beatmap into the server data storage.
|
/// Save the beatmap into the server data storage.
|
||||||
pub(crate) fn save_beatmap(
|
pub(crate) fn save_beatmap(
|
||||||
data: &ShareMap,
|
data: &TypeMap,
|
||||||
channel_id: ChannelId,
|
channel_id: ChannelId,
|
||||||
bm: &BeatmapWithMode,
|
bm: &BeatmapWithMode,
|
||||||
) -> CommandResult {
|
) -> Result<()> {
|
||||||
let db = OsuLastBeatmap::open(data);
|
let db = OsuLastBeatmap::open(data);
|
||||||
let mut db = db.borrow_mut()?;
|
let mut db = db.borrow_mut()?;
|
||||||
|
|
||||||
|
@ -22,9 +19,9 @@ pub(crate) fn save_beatmap(
|
||||||
|
|
||||||
/// Get the last beatmap requested from this channel.
|
/// Get the last beatmap requested from this channel.
|
||||||
pub(crate) fn get_beatmap(
|
pub(crate) fn get_beatmap(
|
||||||
data: &ShareMap,
|
data: &TypeMap,
|
||||||
channel_id: ChannelId,
|
channel_id: ChannelId,
|
||||||
) -> Result<Option<BeatmapWithMode>, Error> {
|
) -> Result<Option<BeatmapWithMode>> {
|
||||||
let db = OsuLastBeatmap::open(data);
|
let db = OsuLastBeatmap::open(data);
|
||||||
let db = db.borrow()?;
|
let db = db.borrow()?;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue