chore: update to edition 2024; update packages; rename some stuff
This commit is contained in:
parent
82e52bc8f9
commit
275d249320
48 changed files with 359 additions and 208 deletions
|
|
@ -2,17 +2,17 @@ mod models;
|
|||
mod repository;
|
||||
mod schema;
|
||||
|
||||
use diesel::Connection;
|
||||
use diesel::connection::InstrumentationEvent;
|
||||
use diesel::r2d2::CustomizeConnection;
|
||||
use diesel::Connection;
|
||||
|
||||
pub use repository::SqliteRepository;
|
||||
|
||||
use diesel::{
|
||||
r2d2::{ConnectionManager, Pool},
|
||||
SqliteConnection,
|
||||
r2d2::{ConnectionManager, Pool},
|
||||
};
|
||||
use diesel_migrations::{embed_migrations, EmbeddedMigrations, MigrationHarness};
|
||||
use diesel_migrations::{EmbeddedMigrations, MigrationHarness, embed_migrations};
|
||||
|
||||
use std::{error::Error, fmt, path::Path};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
use std::{fmt, str::FromStr};
|
||||
|
||||
use diesel::{
|
||||
Selectable,
|
||||
deserialize::{FromSql, FromSqlRow},
|
||||
expression::AsExpression,
|
||||
prelude::{Insertable, Queryable},
|
||||
serialize::ToSql,
|
||||
sql_types::Text,
|
||||
sqlite::{Sqlite, SqliteValue},
|
||||
Selectable,
|
||||
};
|
||||
|
||||
use crate::schema::*;
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ use gpodder::AuthErr;
|
|||
|
||||
use super::SqliteRepository;
|
||||
use crate::{
|
||||
DbError,
|
||||
models::{
|
||||
session::Session,
|
||||
user::{NewUser, User},
|
||||
},
|
||||
schema::*,
|
||||
DbError,
|
||||
};
|
||||
|
||||
impl From<User> for gpodder::User {
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ use gpodder::AuthErr;
|
|||
|
||||
use super::SqliteRepository;
|
||||
use crate::{
|
||||
DbError,
|
||||
models::{
|
||||
device::{Device, DeviceType, NewDevice},
|
||||
sync_group::SyncGroup,
|
||||
},
|
||||
schema::*,
|
||||
DbError,
|
||||
};
|
||||
|
||||
impl From<DeviceType> for gpodder::DeviceType {
|
||||
|
|
@ -157,10 +157,9 @@ impl gpodder::DeviceRepository for SqliteRepository {
|
|||
.execute(conn)?;
|
||||
|
||||
// Add the non-synchronized devices into the new sync group
|
||||
let unsynced_device_ids =
|
||||
devices.iter().filter_map(
|
||||
|(id, group_id)| if group_id.is_none() { Some(id) } else { None },
|
||||
);
|
||||
let unsynced_device_ids = devices
|
||||
.iter()
|
||||
.filter_map(|(id, group_id)| if group_id.is_none() { Some(id) } else { None });
|
||||
|
||||
diesel::update(devices::table.filter(devices::id.eq_any(unsynced_device_ids)))
|
||||
.set(devices::sync_group_id.eq(sync_group_id))
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ use gpodder::AuthErr;
|
|||
|
||||
use super::SqliteRepository;
|
||||
use crate::{
|
||||
DbError,
|
||||
models::{
|
||||
device::Device,
|
||||
episode_action::{ActionType, EpisodeAction, NewEpisodeAction},
|
||||
},
|
||||
schema::*,
|
||||
DbError,
|
||||
};
|
||||
|
||||
impl From<gpodder::EpisodeAction> for NewEpisodeAction {
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ use gpodder::AuthErr;
|
|||
|
||||
use super::SqliteRepository;
|
||||
use crate::{
|
||||
DbError,
|
||||
models::device_subscription::{DeviceSubscription, NewDeviceSubscription},
|
||||
schema::*,
|
||||
DbError,
|
||||
};
|
||||
|
||||
fn set_subscriptions_for_single_device(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue