Remove files over p2p feature (#2364)

* goodbye

* types

* a
This commit is contained in:
Oscar Beaumont 2024-04-20 11:21:20 +08:00 committed by GitHub
parent f97a761346
commit 947354f6c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 2 additions and 11 deletions

View file

@ -64,16 +64,12 @@ pub enum CoreEvent {
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
pub enum BackendFeature {
FilesOverP2P,
CloudSync,
}
impl BackendFeature {
pub fn restore(&self, node: &Node) {
match self {
BackendFeature::FilesOverP2P => {
node.files_over_p2p_flag.store(true, Ordering::Relaxed);
}
BackendFeature::CloudSync => {
node.cloud_sync_flag.store(true, Ordering::Relaxed);
}
@ -181,9 +177,6 @@ pub(crate) fn mount() -> Arc<Router> {
.map_err(|err| rspc::Error::new(ErrorCode::InternalServerError, err.to_string()))?;
match feature {
BackendFeature::FilesOverP2P => {
node.files_over_p2p_flag.store(enabled, Ordering::Relaxed);
}
BackendFeature::CloudSync => {
node.cloud_sync_flag.store(enabled, Ordering::Relaxed);
}

View file

@ -64,7 +64,6 @@ pub struct Node {
pub event_bus: (broadcast::Sender<CoreEvent>, broadcast::Receiver<CoreEvent>),
pub notifications: Notifications,
pub thumbnailer: OldThumbnailer,
pub files_over_p2p_flag: Arc<AtomicBool>,
pub cloud_sync_flag: Arc<AtomicBool>,
pub env: Arc<env::Env>,
pub http: reqwest::Client,
@ -135,7 +134,6 @@ impl Node {
config,
event_bus,
libraries,
files_over_p2p_flag: Arc::new(AtomicBool::new(false)),
cloud_sync_flag: Arc::new(AtomicBool::new(false)),
http: reqwest::Client::new(),
env,

View file

@ -154,7 +154,7 @@ export type AudioMetadata = { duration: number | null; audio_codec: string | nul
*
* If you want a variant of this to show up on the frontend it must be added to `backendFeatures` in `useFeatureFlag.tsx`
*/
export type BackendFeature = "filesOverP2P" | "cloudSync"
export type BackendFeature = "cloudSync"
export type Backup = ({ id: string; timestamp: string; library_id: string; library_name: string }) & { path: string }

View file

@ -16,7 +16,7 @@ export const features = [
// This defines which backend feature flags show up in the UI.
// This is kinda a hack to not having the runtime array of possible features as Specta only exports the types.
export const backendFeatures: BackendFeature[] = ['filesOverP2P', 'cloudSync'];
export const backendFeatures: BackendFeature[] = ['cloudSync'];
export type FeatureFlag = (typeof features)[number] | BackendFeature;