Skip to content

Commit

Permalink
feat(profiles): remove all remaining dead code assotiated with profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mirovladimitrovski authored Jul 17, 2024
1 parent 3fd9add commit 892f41b
Show file tree
Hide file tree
Showing 47 changed files with 29 additions and 1,730 deletions.
13 changes: 0 additions & 13 deletions packages/common/src/controllers/AccountController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,17 @@ import { INTEGRATION_TYPE } from '../modules/types';
import type { ServiceResponse } from '../../types/service';
import { useAccountStore } from '../stores/AccountStore';
import { useConfigStore } from '../stores/ConfigStore';
import { useProfileStore } from '../stores/ProfileStore';
import { FormValidationError } from '../errors/FormValidationError';
import { logError } from '../logger';

import WatchHistoryController from './WatchHistoryController';
import ProfileController from './ProfileController';
import FavoritesController from './FavoritesController';

@injectable()
export default class AccountController {
private readonly checkoutService: CheckoutService;
private readonly accountService: AccountService;
private readonly subscriptionService: SubscriptionService;
private readonly profileController: ProfileController;
private readonly favoritesController: FavoritesController;
private readonly watchHistoryController: WatchHistoryController;
private readonly features: AccountServiceFeatures;
Expand All @@ -46,7 +43,6 @@ export default class AccountController {
@inject(INTEGRATION_TYPE) integrationType: IntegrationType,
favoritesController: FavoritesController,
watchHistoryController: WatchHistoryController,
profileController: ProfileController,
) {
this.checkoutService = getNamedModule(CheckoutService, integrationType);
this.accountService = getNamedModule(AccountService, integrationType);
Expand All @@ -55,7 +51,6 @@ export default class AccountController {
// @TODO: Controllers shouldn't be depending on other controllers, but we've agreed to keep this as is for now
this.favoritesController = favoritesController;
this.watchHistoryController = watchHistoryController;
this.profileController = profileController;

this.features = integrationType ? this.accountService.features : DEFAULT_FEATURES;
}
Expand Down Expand Up @@ -84,7 +79,6 @@ export default class AccountController {
useAccountStore.setState({ loading: true });
const config = useConfigStore.getState().config;

await this.profileController?.loadPersistedProfile();
await this.accountService.initialize(config, url, this.logout);

// set the accessModel before restoring the user session
Expand Down Expand Up @@ -553,13 +547,6 @@ export default class AccountController {
loading: false,
});

useProfileStore.setState({
profile: null,
selectingProfileAvatar: null,
});

this.profileController.unpersistProfile();

await this.favoritesController.restoreFavorites();
await this.watchHistoryController.restoreWatchHistory();
};
Expand Down
118 changes: 0 additions & 118 deletions packages/common/src/controllers/ProfileController.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/common/src/modules/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import SettingsService from '../services/SettingsService';
import WatchHistoryController from '../controllers/WatchHistoryController';
import CheckoutController from '../controllers/CheckoutController';
import AccountController from '../controllers/AccountController';
import ProfileController from '../controllers/ProfileController';
import FavoritesController from '../controllers/FavoritesController';
import AppController from '../controllers/AppController';
import EpgController from '../controllers/EpgController';
Expand All @@ -30,7 +29,6 @@ import JWEpgService from '../services/epg/JWEpgService';
import AccountService from '../services/integrations/AccountService';
import CheckoutService from '../services/integrations/CheckoutService';
import SubscriptionService from '../services/integrations/SubscriptionService';
import ProfileService from '../services/integrations/ProfileService';

// Cleeng integration
import CleengService from '../services/integrations/cleeng/CleengService';
Expand All @@ -43,7 +41,6 @@ import JWPAPIService from '../services/integrations/jwp/JWPAPIService';
import JWPAccountService from '../services/integrations/jwp/JWPAccountService';
import JWPCheckoutService from '../services/integrations/jwp/JWPCheckoutService';
import JWPSubscriptionService from '../services/integrations/jwp/JWPSubscriptionService';
import JWPProfileService from '../services/integrations/jwp/JWPProfileService';
import { getIntegrationType } from './functions/getIntegrationType';
import { isCleengIntegrationType, isJwpIntegrationType } from './functions/calculateIntegrationType';

Expand All @@ -64,7 +61,6 @@ container.bind(EpgController).toSelf();
// Integration controllers
container.bind(AccountController).toSelf();
container.bind(CheckoutController).toSelf();
container.bind(ProfileController).toSelf();

// EPG services
container.bind(EpgService).to(JWEpgService).whenTargetNamed(EPG_TYPE.jwp);
Expand All @@ -87,4 +83,3 @@ container.bind(JWPEntitlementService).toSelf();
container.bind(AccountService).to(JWPAccountService).whenTargetNamed(INTEGRATION.JWP);
container.bind(CheckoutService).to(JWPCheckoutService).whenTargetNamed(INTEGRATION.JWP);
container.bind(SubscriptionService).to(JWPSubscriptionService).whenTargetNamed(INTEGRATION.JWP);
container.bind(ProfileService).to(JWPProfileService).whenTargetNamed(INTEGRATION.JWP);
7 changes: 0 additions & 7 deletions packages/common/src/paths.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,9 @@ export const PATH_USER_BASE = '/u';
export const PATH_USER = `${PATH_USER_BASE}/*`;

export const RELATIVE_PATH_USER_ACCOUNT = 'my-account';
export const RELATIVE_PATH_USER_MY_PROFILE = 'my-profile/:id';
export const RELATIVE_PATH_USER_FAVORITES = 'favorites';
export const RELATIVE_PATH_USER_PAYMENTS = 'payments';
export const RELATIVE_PATH_USER_PROFILES = 'profiles';

export const PATH_USER_ACCOUNT = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_ACCOUNT}`;
export const PATH_USER_MY_PROFILE = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_MY_PROFILE}`;
export const PATH_USER_FAVORITES = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_FAVORITES}`;
export const PATH_USER_PAYMENTS = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PAYMENTS}`;
export const PATH_USER_PROFILES = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PROFILES}`;
export const PATH_USER_PROFILES_CREATE = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PROFILES}/create`;
export const PATH_USER_PROFILES_EDIT = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PROFILES}/edit`;
export const PATH_USER_PROFILES_EDIT_PROFILE = `${PATH_USER_BASE}/${RELATIVE_PATH_USER_PROFILES}/edit/:id`;
15 changes: 0 additions & 15 deletions packages/common/src/services/integrations/ProfileService.ts

This file was deleted.

97 changes: 0 additions & 97 deletions packages/common/src/services/integrations/jwp/JWPProfileService.ts

This file was deleted.

16 changes: 0 additions & 16 deletions packages/common/src/services/integrations/jwp/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,22 +266,6 @@ export type GetItemAccessResponse = {
item: ItemDetails;
};

export type ProfilesData = {
id: string;
account_id: string;
name: string;
avatar_url: string;
default: boolean;
adult: boolean;
pin_required: boolean;
created_at: number;
updated_at: number;
credentials: {
access_token: string;
expires: number;
};
};

export type JWPSubscription = {
cancel_token: string;
status: string;
Expand Down
28 changes: 0 additions & 28 deletions packages/common/src/stores/ProfileStore.ts

This file was deleted.

Loading

0 comments on commit 892f41b

Please sign in to comment.