aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-23 14:10:17 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-06-23 16:00:49 +0200
commit67ed6552b831df66713bac9e672738796128d33f (patch)
tree59c97d41e0b49d75a90aa3de987968ab9b1ff447 /client/src
parent0c4bacbff53bc732f5a2677d62a6ead7752e2405 (diff)
downloadPeerTube-67ed6552b831df66713bac9e672738796128d33f.tar.gz
PeerTube-67ed6552b831df66713bac9e672738796128d33f.tar.zst
PeerTube-67ed6552b831df66713bac9e672738796128d33f.zip
Reorganize client shared modules
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/+about/about-follows/about-follows.component.ts10
-rw-r--r--client/src/app/+about/about-instance/about-instance.component.ts10
-rw-r--r--client/src/app/+about/about-instance/about-instance.resolver.ts11
-rw-r--r--client/src/app/+about/about-instance/contact-admin-modal.component.ts7
-rw-r--r--client/src/app/+about/about-peertube/about-peertube-contributors.component.ts2
-rw-r--r--client/src/app/+about/about.module.ts21
-rw-r--r--client/src/app/+accounts/account-about/account-about.component.ts7
-rw-r--r--client/src/app/+accounts/account-video-channels/account-video-channels.component.ts13
-rw-r--r--client/src/app/+accounts/account-videos/account-videos.component.ts23
-rw-r--r--client/src/app/+accounts/accounts.component.ts16
-rw-r--r--client/src/app/+accounts/accounts.module.ts21
-rw-r--r--client/src/app/+admin/admin-routing.module.ts8
-rw-r--r--client/src/app/+admin/admin.component.ts6
-rw-r--r--client/src/app/+admin/admin.module.ts52
-rw-r--r--client/src/app/+admin/config/config.routes.ts2
-rw-r--r--client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts16
-rw-r--r--client/src/app/+admin/config/shared/config.service.ts6
-rw-r--r--client/src/app/+admin/follows/followers-list/followers-list.component.ts11
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.ts14
-rw-r--r--client/src/app/+admin/follows/follows.routes.ts9
-rw-r--r--client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts2
-rw-r--r--client/src/app/+admin/follows/video-redundancies-list/index.ts1
-rw-r--r--client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts12
-rw-r--r--client/src/app/+admin/moderation/index.ts1
-rw-r--r--client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts6
-rw-r--r--client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts6
-rw-r--r--client/src/app/+admin/moderation/moderation.component.ts2
-rw-r--r--client/src/app/+admin/moderation/moderation.routes.ts8
-rw-r--r--client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts8
-rw-r--r--client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts5
-rw-r--r--client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts25
-rw-r--r--client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts18
-rw-r--r--client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts15
-rw-r--r--client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts14
-rw-r--r--client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts15
-rw-r--r--client/src/app/+admin/plugins/shared/plugin-api.service.ts26
-rw-r--r--client/src/app/+admin/system/debug/debug.component.ts4
-rw-r--r--client/src/app/+admin/system/debug/debug.service.ts7
-rw-r--r--client/src/app/+admin/system/index.ts1
-rw-r--r--client/src/app/+admin/system/jobs/job.service.ts9
-rw-r--r--client/src/app/+admin/system/jobs/jobs.component.ts12
-rw-r--r--client/src/app/+admin/system/logs/log-row.model.ts2
-rw-r--r--client/src/app/+admin/system/logs/logs.component.ts6
-rw-r--r--client/src/app/+admin/system/logs/logs.service.ts9
-rw-r--r--client/src/app/+admin/system/system.routes.ts12
-rw-r--r--client/src/app/+admin/users/user-edit/user-create.component.ts15
-rw-r--r--client/src/app/+admin/users/user-edit/user-edit.ts11
-rw-r--r--client/src/app/+admin/users/user-edit/user-password.component.ts10
-rw-r--r--client/src/app/+admin/users/user-edit/user-update.component.ts18
-rw-r--r--client/src/app/+admin/users/user-list/user-list.component.ts13
-rw-r--r--client/src/app/+admin/users/users.routes.ts8
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts)9
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.html (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html)0
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.scss (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.scss)0
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.ts (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.ts)4
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts)13
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channels-routing.module.ts (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channels-routing.module.ts)0
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.html (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html)0
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.scss (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.scss)0
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.ts (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts)15
-rw-r--r--client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.module.ts (renamed from client/src/app/+my-account/my-account-video-channels/my-account-video-channels.module.ts)18
-rw-r--r--client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.ts6
-rw-r--r--client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts6
-rw-r--r--client/src/app/+my-account/my-account-history/my-account-history.component.ts25
-rw-r--r--client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts2
-rw-r--r--client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts12
-rw-r--r--client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts10
-rw-r--r--client/src/app/+my-account/my-account-routing.module.ts35
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts13
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts10
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts5
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-interface/index.ts1
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts11
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts9
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.html4
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-settings.component.ts9
-rw-r--r--client/src/app/+my-account/my-account-settings/my-account-video-settings/index.ts1
-rw-r--r--client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts9
-rw-r--r--client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.ts9
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts9
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-edit.ts4
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts19
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts16
-rw-r--r--client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts13
-rw-r--r--client/src/app/+my-account/my-account-videos/my-account-videos.component.ts22
-rw-r--r--client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts8
-rw-r--r--client/src/app/+my-account/my-account.component.ts2
-rw-r--r--client/src/app/+my-account/my-account.module.ts72
-rw-r--r--client/src/app/+my-account/top-menu-dropdown.component.html (renamed from client/src/app/shared/menu/top-menu-dropdown.component.html)0
-rw-r--r--client/src/app/+my-account/top-menu-dropdown.component.scss (renamed from client/src/app/shared/menu/top-menu-dropdown.component.scss)0
-rw-r--r--client/src/app/+my-account/top-menu-dropdown.component.ts (renamed from client/src/app/shared/menu/top-menu-dropdown.component.ts)15
-rw-r--r--client/src/app/+page-not-found/page-not-found.module.ts11
-rw-r--r--client/src/app/+signup/+register/register-routing.module.ts3
-rw-r--r--client/src/app/+signup/+register/register-step-channel.component.ts10
-rw-r--r--client/src/app/+signup/+register/register-step-user.component.ts10
-rw-r--r--client/src/app/+signup/+register/register.component.ts16
-rw-r--r--client/src/app/+signup/+register/register.module.ts19
-rw-r--r--client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts7
-rw-r--r--client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts6
-rw-r--r--client/src/app/+signup/+verify-account/verify-account.module.ts9
-rw-r--r--client/src/app/+signup/shared/signup-shared.module.ts14
-rw-r--r--client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts7
-rw-r--r--client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts14
-rw-r--r--client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts23
-rw-r--r--client/src/app/+video-channels/video-channels-routing.module.ts6
-rw-r--r--client/src/app/+video-channels/video-channels.component.ts16
-rw-r--r--client/src/app/+video-channels/video-channels.module.ts21
-rw-r--r--client/src/app/app-routing.module.ts3
-rw-r--r--client/src/app/app.component.ts34
-rw-r--r--client/src/app/app.module.ts40
-rw-r--r--client/src/app/core/auth/auth-user.model.ts18
-rw-r--r--client/src/app/core/auth/auth.service.ts13
-rw-r--r--client/src/app/core/core.module.ts48
-rw-r--r--client/src/app/core/index.ts9
-rw-r--r--client/src/app/core/menu/menu.service.ts4
-rw-r--r--client/src/app/core/notification/user-notification-socket.service.ts4
-rw-r--r--client/src/app/core/plugins/hooks.service.ts3
-rw-r--r--client/src/app/core/plugins/index.ts2
-rw-r--r--client/src/app/core/plugins/plugin.service.ts44
-rw-r--r--client/src/app/core/renderer/html-renderer.service.ts (renamed from client/src/app/shared/renderer/html-renderer.service.ts)2
-rw-r--r--client/src/app/core/renderer/index.ts (renamed from client/src/app/shared/renderer/index.ts)0
-rw-r--r--client/src/app/core/renderer/linkifier.service.ts (renamed from client/src/app/shared/renderer/linkifier.service.ts)2
-rw-r--r--client/src/app/core/renderer/markdown.service.ts (renamed from client/src/app/shared/renderer/markdown.service.ts)6
-rw-r--r--client/src/app/core/rest/component-pagination.model.ts (renamed from client/src/app/shared/rest/component-pagination.model.ts)0
-rw-r--r--client/src/app/core/rest/index.ts (renamed from client/src/app/shared/rest/index.ts)3
-rw-r--r--client/src/app/core/rest/rest-extractor.service.ts (renamed from client/src/app/shared/rest/rest-extractor.service.ts)4
-rw-r--r--client/src/app/core/rest/rest-pagination.ts (renamed from client/src/app/shared/rest/rest-pagination.ts)0
-rw-r--r--client/src/app/core/rest/rest-table.ts (renamed from client/src/app/shared/rest/rest-table.ts)2
-rw-r--r--client/src/app/core/rest/rest.service.ts (renamed from client/src/app/shared/rest/rest.service.ts)0
-rw-r--r--client/src/app/core/routing/can-deactivate-guard.service.ts (renamed from client/src/app/shared/guards/can-deactivate-guard.service.ts)4
-rw-r--r--client/src/app/core/routing/index.ts9
-rw-r--r--client/src/app/core/routing/login-guard.service.ts1
-rw-r--r--client/src/app/core/routing/menu-guard.service.ts4
-rw-r--r--client/src/app/core/routing/preload-selected-modules-list.ts1
-rw-r--r--client/src/app/core/routing/server-config-resolver.service.ts2
-rw-r--r--client/src/app/core/routing/unlogged-guard.service.ts3
-rw-r--r--client/src/app/core/routing/user-right-guard.service.ts9
-rw-r--r--client/src/app/core/server/server.service.ts18
-rw-r--r--client/src/app/core/theme/theme.service.ts16
-rw-r--r--client/src/app/core/users/index.ts (renamed from client/src/app/shared/users/index.ts)1
-rw-r--r--client/src/app/core/users/user.model.ts (renamed from client/src/app/shared/users/user.model.ts)14
-rw-r--r--client/src/app/core/users/user.service.ts (renamed from client/src/app/shared/users/user.service.ts)20
-rw-r--r--client/src/app/core/wrappers/index.ts2
-rw-r--r--client/src/app/core/wrappers/screen.service.ts (renamed from client/src/app/shared/misc/screen.service.ts)0
-rw-r--r--client/src/app/core/wrappers/storage.service.ts (renamed from client/src/app/shared/misc/storage.service.ts)7
-rw-r--r--client/src/app/header/search-typeahead.component.ts7
-rw-r--r--client/src/app/header/suggestion.component.ts4
-rw-r--r--client/src/app/helpers/constants.ts (renamed from client/src/app/shared/misc/constants.ts)0
-rw-r--r--client/src/app/helpers/i18n-utils.ts (renamed from client/src/app/shared/i18n/i18n-utils.ts)2
-rw-r--r--client/src/app/helpers/index.ts6
-rw-r--r--client/src/app/helpers/locales/index.ts1
-rw-r--r--client/src/app/helpers/locales/oc.ts (renamed from client/src/app/shared/locale/oc.ts)0
-rw-r--r--client/src/app/helpers/peertube-web-storage.ts (renamed from client/src/app/shared/misc/peertube-web-storage.ts)0
-rw-r--r--client/src/app/helpers/utils.ts (renamed from client/src/app/shared/misc/utils.ts)4
-rw-r--r--client/src/app/helpers/zone.ts (renamed from client/src/app/shared/rxjs/zone.ts)0
-rw-r--r--client/src/app/login/login.component.ts18
-rw-r--r--client/src/app/login/login.module.ts10
-rw-r--r--client/src/app/menu/avatar-notification.component.ts11
-rw-r--r--client/src/app/menu/language-chooser.component.ts8
-rw-r--r--client/src/app/menu/menu.component.ts10
-rw-r--r--client/src/app/modal/confirm.component.html (renamed from client/src/app/shared/confirm/confirm.component.html)0
-rw-r--r--client/src/app/modal/confirm.component.scss (renamed from client/src/app/shared/confirm/confirm.component.scss)0
-rw-r--r--client/src/app/modal/confirm.component.ts (renamed from client/src/app/shared/confirm/confirm.component.ts)6
-rw-r--r--client/src/app/modal/instance-config-warning-modal.component.ts3
-rw-r--r--client/src/app/modal/quick-settings-modal.component.html8
-rw-r--r--client/src/app/modal/quick-settings-modal.component.ts11
-rw-r--r--client/src/app/modal/welcome-modal.component.ts3
-rw-r--r--client/src/app/reset-password/reset-password-routing.module.ts2
-rw-r--r--client/src/app/reset-password/reset-password.component.ts6
-rw-r--r--client/src/app/reset-password/reset-password.module.ts8
-rw-r--r--client/src/app/search/advanced-search.model.ts3
-rw-r--r--client/src/app/search/highlight.pipe.ts (renamed from client/src/app/shared/angular/highlight.pipe.ts)0
-rw-r--r--client/src/app/search/search-filters.component.ts6
-rw-r--r--client/src/app/search/search.component.ts19
-rw-r--r--client/src/app/search/search.module.ts22
-rw-r--r--client/src/app/search/search.service.ts14
-rw-r--r--client/src/app/shared/angular/object-length.pipe.ts8
-rw-r--r--client/src/app/shared/blocklist/index.ts4
-rw-r--r--client/src/app/shared/forms/index.ts4
-rw-r--r--client/src/app/shared/index.ts7
-rw-r--r--client/src/app/shared/moderation/index.ts2
-rw-r--r--client/src/app/shared/overview/index.ts1
-rw-r--r--client/src/app/shared/shared-forms/form-reactive.ts (renamed from client/src/app/shared/forms/form-reactive.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/batch-domains-validators.service.ts (renamed from client/src/app/+admin/config/shared/batch-domains-validators.service.ts)7
-rw-r--r--client/src/app/shared/shared-forms/form-validators/custom-config-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/custom-config-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/form-validator.service.ts (renamed from client/src/app/shared/forms/form-validators/form-validator.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/host.ts (renamed from client/src/app/shared/forms/form-validators/host.ts)0
-rw-r--r--client/src/app/shared/shared-forms/form-validators/index.ts (renamed from client/src/app/shared/forms/form-validators/index.ts)9
-rw-r--r--client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/instance-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/login-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/login-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/reset-password-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/reset-password-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/user-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/user-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-abuse-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-accept-ownership-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/video-accept-ownership-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/video-block-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-captions-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/video-captions-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/video-change-ownership-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/video-channel-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-comment-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/video-comment-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/video-playlist-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/form-validators/video-validators.service.ts (renamed from client/src/app/shared/forms/form-validators/video-validators.service.ts)2
-rw-r--r--client/src/app/shared/shared-forms/index.ts10
-rw-r--r--client/src/app/shared/shared-forms/input-readonly-copy.component.html (renamed from client/src/app/shared/forms/input-readonly-copy.component.html)0
-rw-r--r--client/src/app/shared/shared-forms/input-readonly-copy.component.scss (renamed from client/src/app/shared/forms/input-readonly-copy.component.scss)0
-rw-r--r--client/src/app/shared/shared-forms/input-readonly-copy.component.ts (renamed from client/src/app/shared/forms/input-readonly-copy.component.ts)0
-rw-r--r--client/src/app/shared/shared-forms/markdown-textarea.component.html (renamed from client/src/app/shared/forms/markdown-textarea.component.html)0
-rw-r--r--client/src/app/shared/shared-forms/markdown-textarea.component.scss (renamed from client/src/app/shared/forms/markdown-textarea.component.scss)0
-rw-r--r--client/src/app/shared/shared-forms/markdown-textarea.component.ts (renamed from client/src/app/shared/forms/markdown-textarea.component.ts)14
-rw-r--r--client/src/app/shared/shared-forms/peertube-checkbox.component.html (renamed from client/src/app/shared/forms/peertube-checkbox.component.html)0
-rw-r--r--client/src/app/shared/shared-forms/peertube-checkbox.component.scss (renamed from client/src/app/shared/forms/peertube-checkbox.component.scss)0
-rw-r--r--client/src/app/shared/shared-forms/peertube-checkbox.component.ts (renamed from client/src/app/shared/forms/peertube-checkbox.component.ts)2
-rw-r--r--client/src/app/shared/shared-forms/preview-upload.component.html (renamed from client/src/app/shared/images/preview-upload.component.html)0
-rw-r--r--client/src/app/shared/shared-forms/preview-upload.component.scss (renamed from client/src/app/shared/images/preview-upload.component.scss)0
-rw-r--r--client/src/app/shared/shared-forms/preview-upload.component.ts (renamed from client/src/app/shared/images/preview-upload.component.ts)0
-rw-r--r--client/src/app/shared/shared-forms/reactive-file.component.html (renamed from client/src/app/shared/forms/reactive-file.component.html)0
-rw-r--r--client/src/app/shared/shared-forms/reactive-file.component.scss (renamed from client/src/app/shared/forms/reactive-file.component.scss)0
-rw-r--r--client/src/app/shared/shared-forms/reactive-file.component.ts (renamed from client/src/app/shared/forms/reactive-file.component.ts)2
-rw-r--r--client/src/app/shared/shared-forms/shared-form.module.ts84
-rw-r--r--client/src/app/shared/shared-forms/textarea-autoresize.directive.ts (renamed from client/src/app/shared/forms/textarea-autoresize.directive.ts)0
-rw-r--r--client/src/app/shared/shared-forms/timestamp-input.component.html (renamed from client/src/app/shared/forms/timestamp-input.component.html)0
-rw-r--r--client/src/app/shared/shared-forms/timestamp-input.component.scss (renamed from client/src/app/shared/forms/timestamp-input.component.scss)0
-rw-r--r--client/src/app/shared/shared-forms/timestamp-input.component.ts (renamed from client/src/app/shared/forms/timestamp-input.component.ts)0
-rw-r--r--client/src/app/shared/shared-icons/global-icon.component.scss (renamed from client/src/app/shared/images/global-icon.component.scss)0
-rw-r--r--client/src/app/shared/shared-icons/global-icon.component.ts (renamed from client/src/app/shared/images/global-icon.component.ts)0
-rw-r--r--client/src/app/shared/shared-icons/index.ts3
-rw-r--r--client/src/app/shared/shared-icons/shared-global-icon.module.ts21
-rw-r--r--client/src/app/shared/shared-instance/feature-boolean.component.html (renamed from client/src/app/shared/instance/feature-boolean.component.html)0
-rw-r--r--client/src/app/shared/shared-instance/feature-boolean.component.scss (renamed from client/src/app/shared/instance/feature-boolean.component.scss)0
-rw-r--r--client/src/app/shared/shared-instance/feature-boolean.component.ts (renamed from client/src/app/shared/instance/feature-boolean.component.ts)0
-rw-r--r--client/src/app/shared/shared-instance/index.ts6
-rw-r--r--client/src/app/shared/shared-instance/instance-features-table.component.html (renamed from client/src/app/shared/instance/instance-features-table.component.html)0
-rw-r--r--client/src/app/shared/shared-instance/instance-features-table.component.scss (renamed from client/src/app/shared/instance/instance-features-table.component.scss)0
-rw-r--r--client/src/app/shared/shared-instance/instance-features-table.component.ts (renamed from client/src/app/shared/instance/instance-features-table.component.ts)0
-rw-r--r--client/src/app/shared/shared-instance/instance-follow.service.ts (renamed from client/src/app/shared/instance/follow.service.ts)22
-rw-r--r--client/src/app/shared/shared-instance/instance-statistics.component.html (renamed from client/src/app/shared/instance/instance-statistics.component.html)0
-rw-r--r--client/src/app/shared/shared-instance/instance-statistics.component.scss (renamed from client/src/app/shared/instance/instance-statistics.component.scss)0
-rw-r--r--client/src/app/shared/shared-instance/instance-statistics.component.ts (renamed from client/src/app/shared/instance/instance-statistics.component.ts)0
-rw-r--r--client/src/app/shared/shared-instance/instance.service.ts (renamed from client/src/app/shared/instance/instance.service.ts)10
-rw-r--r--client/src/app/shared/shared-instance/shared-instance.module.ts32
-rw-r--r--client/src/app/shared/shared-main/account/account.model.ts (renamed from client/src/app/shared/account/account.model.ts)4
-rw-r--r--client/src/app/shared/shared-main/account/account.service.ts (renamed from client/src/app/shared/account/account.service.ts)12
-rw-r--r--client/src/app/shared/shared-main/account/actor-avatar-info.component.html (renamed from client/src/app/+my-account/shared/actor-avatar-info.component.html)0
-rw-r--r--client/src/app/shared/shared-main/account/actor-avatar-info.component.scss (renamed from client/src/app/+my-account/shared/actor-avatar-info.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/account/actor-avatar-info.component.ts (renamed from client/src/app/+my-account/shared/actor-avatar-info.component.ts)10
-rw-r--r--client/src/app/shared/shared-main/account/actor.model.ts (renamed from client/src/app/shared/actor/actor.model.ts)5
-rw-r--r--client/src/app/shared/shared-main/account/avatar.component.html (renamed from client/src/app/shared/channel/avatar.component.html)0
-rw-r--r--client/src/app/shared/shared-main/account/avatar.component.scss (renamed from client/src/app/shared/channel/avatar.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/account/avatar.component.ts (renamed from client/src/app/shared/channel/avatar.component.ts)0
-rw-r--r--client/src/app/shared/shared-main/account/index.ts5
-rw-r--r--client/src/app/shared/shared-main/angular/from-now.pipe.ts (renamed from client/src/app/shared/angular/from-now.pipe.ts)0
-rw-r--r--client/src/app/shared/shared-main/angular/index.ts4
-rw-r--r--client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts (renamed from client/src/app/shared/video/infinite-scroller.directive.ts)0
-rw-r--r--client/src/app/shared/shared-main/angular/number-formatter.pipe.ts (renamed from client/src/app/shared/angular/number-formatter.pipe.ts)0
-rw-r--r--client/src/app/shared/shared-main/angular/peertube-template.directive.ts (renamed from client/src/app/shared/angular/peertube-template.directive.ts)0
-rw-r--r--client/src/app/shared/shared-main/auth/auth-interceptor.service.ts (renamed from client/src/app/shared/auth/auth-interceptor.service.ts)4
-rw-r--r--client/src/app/shared/shared-main/auth/index.ts (renamed from client/src/app/shared/auth/index.ts)0
-rw-r--r--client/src/app/shared/shared-main/buttons/action-dropdown.component.html (renamed from client/src/app/shared/buttons/action-dropdown.component.html)0
-rw-r--r--client/src/app/shared/shared-main/buttons/action-dropdown.component.scss (renamed from client/src/app/shared/buttons/action-dropdown.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/buttons/action-dropdown.component.ts (renamed from client/src/app/shared/buttons/action-dropdown.component.ts)2
-rw-r--r--client/src/app/shared/shared-main/buttons/button.component.html (renamed from client/src/app/shared/buttons/button.component.html)0
-rw-r--r--client/src/app/shared/shared-main/buttons/button.component.scss (renamed from client/src/app/shared/buttons/button.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/buttons/button.component.ts (renamed from client/src/app/shared/buttons/button.component.ts)2
-rw-r--r--client/src/app/shared/shared-main/buttons/delete-button.component.html (renamed from client/src/app/shared/buttons/delete-button.component.html)0
-rw-r--r--client/src/app/shared/shared-main/buttons/delete-button.component.ts (renamed from client/src/app/shared/buttons/delete-button.component.ts)0
-rw-r--r--client/src/app/shared/shared-main/buttons/edit-button.component.html (renamed from client/src/app/shared/buttons/edit-button.component.html)0
-rw-r--r--client/src/app/shared/shared-main/buttons/edit-button.component.ts (renamed from client/src/app/shared/buttons/edit-button.component.ts)0
-rw-r--r--client/src/app/shared/shared-main/buttons/index.ts4
-rw-r--r--client/src/app/shared/shared-main/date/date-toggle.component.html (renamed from client/src/app/shared/date/date-toggle.component.html)0
-rw-r--r--client/src/app/shared/shared-main/date/date-toggle.component.scss (renamed from client/src/app/shared/date/date-toggle.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/date/date-toggle.component.ts (renamed from client/src/app/shared/date/date-toggle.component.ts)5
-rw-r--r--client/src/app/shared/shared-main/date/index.ts1
-rw-r--r--client/src/app/shared/shared-main/feeds/feed.component.html (renamed from client/src/app/shared/video/feed.component.html)0
-rw-r--r--client/src/app/shared/shared-main/feeds/feed.component.scss (renamed from client/src/app/shared/video/feed.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/feeds/feed.component.ts (renamed from client/src/app/shared/video/feed.component.ts)2
-rw-r--r--client/src/app/shared/shared-main/feeds/index.ts2
-rw-r--r--client/src/app/shared/shared-main/feeds/syndication.model.ts (renamed from client/src/app/shared/video/syndication.model.ts)2
-rw-r--r--client/src/app/shared/shared-main/index.ts12
-rw-r--r--client/src/app/shared/shared-main/loaders/index.ts2
-rw-r--r--client/src/app/shared/shared-main/loaders/loader.component.html (renamed from client/src/app/shared/misc/loader.component.html)0
-rw-r--r--client/src/app/shared/shared-main/loaders/loader.component.scss (renamed from client/src/app/shared/misc/loader.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/loaders/loader.component.ts (renamed from client/src/app/shared/misc/loader.component.ts)0
-rw-r--r--client/src/app/shared/shared-main/loaders/small-loader.component.html (renamed from client/src/app/shared/misc/small-loader.component.html)0
-rw-r--r--client/src/app/shared/shared-main/loaders/small-loader.component.ts (renamed from client/src/app/shared/misc/small-loader.component.ts)0
-rw-r--r--client/src/app/shared/shared-main/misc/help.component.html (renamed from client/src/app/shared/misc/help.component.html)0
-rw-r--r--client/src/app/shared/shared-main/misc/help.component.scss (renamed from client/src/app/shared/misc/help.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/misc/help.component.ts (renamed from client/src/app/shared/misc/help.component.ts)4
-rw-r--r--client/src/app/shared/shared-main/misc/index.ts2
-rw-r--r--client/src/app/shared/shared-main/misc/list-overflow.component.html (renamed from client/src/app/shared/misc/list-overflow.component.html)0
-rw-r--r--client/src/app/shared/shared-main/misc/list-overflow.component.scss (renamed from client/src/app/shared/misc/list-overflow.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/misc/list-overflow.component.ts (renamed from client/src/app/shared/misc/list-overflow.component.ts)6
-rw-r--r--client/src/app/shared/shared-main/shared-main.module.ts164
-rw-r--r--client/src/app/shared/shared-main/users/index.ts4
-rw-r--r--client/src/app/shared/shared-main/users/user-history.service.ts (renamed from client/src/app/shared/users/user-history.service.ts)12
-rw-r--r--client/src/app/shared/shared-main/users/user-notification.model.ts (renamed from client/src/app/shared/users/user-notification.model.ts)4
-rw-r--r--client/src/app/shared/shared-main/users/user-notification.service.ts (renamed from client/src/app/shared/users/user-notification.service.ts)15
-rw-r--r--client/src/app/shared/shared-main/users/user-notifications.component.html (renamed from client/src/app/shared/users/user-notifications.component.html)0
-rw-r--r--client/src/app/shared/shared-main/users/user-notifications.component.scss (renamed from client/src/app/shared/users/user-notifications.component.scss)0
-rw-r--r--client/src/app/shared/shared-main/users/user-notifications.component.ts (renamed from client/src/app/shared/users/user-notifications.component.ts)11
-rw-r--r--client/src/app/shared/shared-main/video-caption/index.ts2
-rw-r--r--client/src/app/shared/shared-main/video-caption/video-caption-edit.model.ts (renamed from client/src/app/shared/video-caption/video-caption-edit.model.ts)0
-rw-r--r--client/src/app/shared/shared-main/video-caption/video-caption.service.ts (renamed from client/src/app/shared/video-caption/video-caption.service.ts)14
-rw-r--r--client/src/app/shared/shared-main/video-channel/index.ts2
-rw-r--r--client/src/app/shared/shared-main/video-channel/video-channel.model.ts (renamed from client/src/app/shared/video-channel/video-channel.model.ts)5
-rw-r--r--client/src/app/shared/shared-main/video-channel/video-channel.service.ts (renamed from client/src/app/shared/video-channel/video-channel.service.ts)16
-rw-r--r--client/src/app/shared/shared-main/video/index.ts7
-rw-r--r--client/src/app/shared/shared-main/video/redundancy.service.ts (renamed from client/src/app/shared/video/redundancy.service.ts)8
-rw-r--r--client/src/app/shared/shared-main/video/video-details.model.ts (renamed from client/src/app/shared/video/video-details.model.ts)17
-rw-r--r--client/src/app/shared/shared-main/video/video-edit.model.ts (renamed from client/src/app/shared/video/video-edit.model.ts)5
-rw-r--r--client/src/app/shared/shared-main/video/video-import.service.ts (renamed from client/src/app/shared/video-import/video-import.service.ts)17
-rw-r--r--client/src/app/shared/shared-main/video/video-ownership.service.ts (renamed from client/src/app/shared/video-ownership/video-ownership.service.ts)13
-rw-r--r--client/src/app/shared/shared-main/video/video.model.ts (renamed from client/src/app/shared/video/video.model.ts)24
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts (renamed from client/src/app/shared/video/video.service.ts)59
-rw-r--r--client/src/app/shared/shared-moderation/account-block.model.ts (renamed from client/src/app/shared/blocklist/account-block.model.ts)4
-rw-r--r--client/src/app/shared/shared-moderation/account-blocklist.component.html (renamed from client/src/app/shared/blocklist/account-blocklist.component.html)0
-rw-r--r--client/src/app/shared/shared-moderation/account-blocklist.component.scss (renamed from client/src/app/shared/blocklist/account-blocklist.component.scss)0
-rw-r--r--client/src/app/shared/shared-moderation/account-blocklist.component.ts (renamed from client/src/app/shared/blocklist/account-blocklist.component.ts)9
-rw-r--r--client/src/app/shared/shared-moderation/batch-domains-modal.component.html (renamed from client/src/app/+admin/config/shared/batch-domains-modal.component.html)0
-rw-r--r--client/src/app/shared/shared-moderation/batch-domains-modal.component.scss (renamed from client/src/app/+admin/config/shared/batch-domains-modal.component.scss)0
-rw-r--r--client/src/app/shared/shared-moderation/batch-domains-modal.component.ts (renamed from client/src/app/+admin/config/shared/batch-domains-modal.component.ts)8
-rw-r--r--client/src/app/shared/shared-moderation/blocklist.service.ts (renamed from client/src/app/shared/blocklist/blocklist.service.ts)14
-rw-r--r--client/src/app/shared/shared-moderation/bulk.service.ts (renamed from client/src/app/shared/bulk/bulk.service.ts)9
-rw-r--r--client/src/app/shared/shared-moderation/index.ts13
-rw-r--r--client/src/app/shared/shared-moderation/server-blocklist.component.html (renamed from client/src/app/shared/blocklist/server-blocklist.component.html)0
-rw-r--r--client/src/app/shared/shared-moderation/server-blocklist.component.scss (renamed from client/src/app/shared/blocklist/server-blocklist.component.scss)0
-rw-r--r--client/src/app/shared/shared-moderation/server-blocklist.component.ts (renamed from client/src/app/shared/blocklist/server-blocklist.component.ts)17
-rw-r--r--client/src/app/shared/shared-moderation/shared-moderation.module.ts46
-rw-r--r--client/src/app/shared/shared-moderation/user-ban-modal.component.html (renamed from client/src/app/shared/moderation/user-ban-modal.component.html)0
-rw-r--r--client/src/app/shared/shared-moderation/user-ban-modal.component.scss (renamed from client/src/app/shared/moderation/user-ban-modal.component.scss)0
-rw-r--r--client/src/app/shared/shared-moderation/user-ban-modal.component.ts (renamed from client/src/app/shared/moderation/user-ban-modal.component.ts)10
-rw-r--r--client/src/app/shared/shared-moderation/user-moderation-dropdown.component.html (renamed from client/src/app/shared/moderation/user-moderation-dropdown.component.html)0
-rw-r--r--client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts (renamed from client/src/app/shared/moderation/user-moderation-dropdown.component.ts)15
-rw-r--r--client/src/app/shared/shared-moderation/video-abuse.service.ts (renamed from client/src/app/shared/video-abuse/video-abuse.service.ts)10
-rw-r--r--client/src/app/shared/shared-moderation/video-block.component.html (renamed from client/src/app/shared/video/modals/video-block.component.html)0
-rw-r--r--client/src/app/shared/shared-moderation/video-block.component.scss (renamed from client/src/app/shared/video/modals/video-block.component.scss)0
-rw-r--r--client/src/app/shared/shared-moderation/video-block.component.ts (renamed from client/src/app/shared/video/modals/video-block.component.ts)11
-rw-r--r--client/src/app/shared/shared-moderation/video-block.service.ts (renamed from client/src/app/shared/video-block/video-block.service.ts)10
-rw-r--r--client/src/app/shared/shared-moderation/video-report.component.html (renamed from client/src/app/shared/video/modals/video-report.component.html)0
-rw-r--r--client/src/app/shared/shared-moderation/video-report.component.scss (renamed from client/src/app/shared/video/modals/video-report.component.scss)0
-rw-r--r--client/src/app/shared/shared-moderation/video-report.component.ts (renamed from client/src/app/shared/video/modals/video-report.component.ts)18
-rw-r--r--client/src/app/shared/shared-thumbnail/index.ts2
-rw-r--r--client/src/app/shared/shared-thumbnail/shared-thumbnail.module.ts23
-rw-r--r--client/src/app/shared/shared-thumbnail/video-thumbnail.component.html (renamed from client/src/app/shared/video/video-thumbnail.component.html)0
-rw-r--r--client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss (renamed from client/src/app/shared/video/video-thumbnail.component.scss)0
-rw-r--r--client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts (renamed from client/src/app/shared/video/video-thumbnail.component.ts)4
-rw-r--r--client/src/app/shared/shared-user-settings/index.ts4
-rw-r--r--client/src/app/shared/shared-user-settings/shared-user-settings.module.ts26
-rw-r--r--client/src/app/shared/shared-user-settings/user-interface-settings.component.html (renamed from client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.html)0
-rw-r--r--client/src/app/shared/shared-user-settings/user-interface-settings.component.scss (renamed from client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.scss)0
-rw-r--r--client/src/app/shared/shared-user-settings/user-interface-settings.component.ts (renamed from client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.ts)21
-rw-r--r--client/src/app/shared/shared-user-settings/user-video-settings.component.html (renamed from client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html)0
-rw-r--r--client/src/app/shared/shared-user-settings/user-video-settings.component.scss (renamed from client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.scss)0
-rw-r--r--client/src/app/shared/shared-user-settings/user-video-settings.component.ts (renamed from client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts)25
-rw-r--r--client/src/app/shared/shared-user-subscription/index.ts (renamed from client/src/app/shared/user-subscription/index.ts)2
-rw-r--r--client/src/app/shared/shared-user-subscription/remote-subscribe.component.html (renamed from client/src/app/shared/user-subscription/remote-subscribe.component.html)0
-rw-r--r--client/src/app/shared/shared-user-subscription/remote-subscribe.component.scss (renamed from client/src/app/shared/user-subscription/remote-subscribe.component.scss)0
-rw-r--r--client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts (renamed from client/src/app/shared/user-subscription/remote-subscribe.component.ts)6
-rw-r--r--client/src/app/shared/shared-user-subscription/shared-user-subscription.module.ts29
-rw-r--r--client/src/app/shared/shared-user-subscription/subscribe-button.component.html (renamed from client/src/app/shared/user-subscription/subscribe-button.component.html)0
-rw-r--r--client/src/app/shared/shared-user-subscription/subscribe-button.component.scss (renamed from client/src/app/shared/user-subscription/subscribe-button.component.scss)0
-rw-r--r--client/src/app/shared/shared-user-subscription/subscribe-button.component.ts (renamed from client/src/app/shared/user-subscription/subscribe-button.component.ts)12
-rw-r--r--client/src/app/shared/shared-user-subscription/user-subscription.service.ts (renamed from client/src/app/shared/user-subscription/user-subscription.service.ts)39
-rw-r--r--client/src/app/shared/shared-video-miniature/abstract-video-list.html (renamed from client/src/app/shared/video/abstract-video-list.html)0
-rw-r--r--client/src/app/shared/shared-video-miniature/abstract-video-list.scss (renamed from client/src/app/shared/video/abstract-video-list.scss)0
-rw-r--r--client/src/app/shared/shared-video-miniature/abstract-video-list.ts (renamed from client/src/app/shared/video/abstract-video-list.ts)30
-rw-r--r--client/src/app/shared/shared-video-miniature/index.ts7
-rw-r--r--client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts40
-rw-r--r--client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html (renamed from client/src/app/shared/video/video-actions-dropdown.component.html)0
-rw-r--r--client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.scss (renamed from client/src/app/shared/video/video-actions-dropdown.component.scss)0
-rw-r--r--client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts (renamed from client/src/app/shared/video/video-actions-dropdown.component.ts)19
-rw-r--r--client/src/app/shared/shared-video-miniature/video-download.component.html (renamed from client/src/app/shared/video/modals/video-download.component.html)0
-rw-r--r--client/src/app/shared/shared-video-miniature/video-download.component.scss (renamed from client/src/app/shared/video/modals/video-download.component.scss)0
-rw-r--r--client/src/app/shared/shared-video-miniature/video-download.component.ts (renamed from client/src/app/shared/video/modals/video-download.component.ts)14
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.html (renamed from client/src/app/shared/video/video-miniature.component.html)0
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.scss (renamed from client/src/app/shared/video/video-miniature.component.scss)0
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.ts (renamed from client/src/app/shared/video/video-miniature.component.ts)10
-rw-r--r--client/src/app/shared/shared-video-miniature/videos-selection.component.html (renamed from client/src/app/shared/video/videos-selection.component.html)0
-rw-r--r--client/src/app/shared/shared-video-miniature/videos-selection.component.scss (renamed from client/src/app/shared/video/videos-selection.component.scss)0
-rw-r--r--client/src/app/shared/shared-video-miniature/videos-selection.component.ts (renamed from client/src/app/shared/video/videos-selection.component.ts)18
-rw-r--r--client/src/app/shared/shared-video-playlist/index.ts8
-rw-r--r--client/src/app/shared/shared-video-playlist/shared-video-playlist.module.ts36
-rw-r--r--client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html (renamed from client/src/app/shared/video-playlist/video-add-to-playlist.component.html)0
-rw-r--r--client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.scss (renamed from client/src/app/shared/video-playlist/video-add-to-playlist.component.scss)0
-rw-r--r--client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts (renamed from client/src/app/shared/video-playlist/video-add-to-playlist.component.ts)14
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html (renamed from client/src/app/shared/video-playlist/video-playlist-element-miniature.component.html)0
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss (renamed from client/src/app/shared/video-playlist/video-playlist-element-miniature.component.scss)0
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts (renamed from client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts)19
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts (renamed from client/src/app/shared/video-playlist/video-playlist-element.model.ts)2
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html (renamed from client/src/app/shared/video-playlist/video-playlist-miniature.component.html)0
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.scss (renamed from client/src/app/shared/video-playlist/video-playlist-miniature.component.scss)0
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts (renamed from client/src/app/shared/video-playlist/video-playlist-miniature.component.ts)2
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist.model.ts (renamed from client/src/app/shared/video-playlist/video-playlist.model.ts)9
-rw-r--r--client/src/app/shared/shared-video-playlist/video-playlist.service.ts (renamed from client/src/app/shared/video-playlist/video-playlist.service.ts)44
-rw-r--r--client/src/app/shared/shared.module.ts337
-rw-r--r--client/src/app/shared/video-abuse/index.ts1
-rw-r--r--client/src/app/shared/video-block/index.ts1
-rw-r--r--client/src/app/shared/video-caption/index.ts1
-rw-r--r--client/src/app/shared/video-import/index.ts1
-rw-r--r--client/src/app/shared/video-ownership/index.ts1
-rw-r--r--client/src/app/shared/video/sort-field.type.ts10
-rw-r--r--client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts (renamed from client/src/app/shared/i18n/i18n-primeng-calendar.ts)0
-rw-r--r--client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts8
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.ts26
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.module.ts16
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts18
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts20
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-send.ts16
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts19
-rw-r--r--client/src/app/videos/+video-edit/video-add-routing.module.ts5
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.ts9
-rw-r--r--client/src/app/videos/+video-edit/video-add.module.ts23
-rw-r--r--client/src/app/videos/+video-edit/video-update-routing.module.ts7
-rw-r--r--client/src/app/videos/+video-edit/video-update.component.ts12
-rw-r--r--client/src/app/videos/+video-edit/video-update.module.ts13
-rw-r--r--client/src/app/videos/+video-edit/video-update.resolver.ts8
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment-add.component.ts15
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts4
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.component.ts14
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.model.ts7
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.service.ts17
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comments.component.ts21
-rw-r--r--client/src/app/videos/+video-watch/modal/video-share.component.ts8
-rw-r--r--client/src/app/videos/+video-watch/modal/video-support.component.ts4
-rw-r--r--client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts (renamed from client/src/app/shared/angular/timestamp-route-transformer.directive.ts)0
-rw-r--r--client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts (renamed from client/src/app/shared/angular/video-duration-formatter.pipe.ts)0
-rw-r--r--client/src/app/videos/+video-watch/video-watch-playlist.component.ts13
-rw-r--r--client/src/app/videos/+video-watch/video-watch-routing.module.ts2
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts42
-rw-r--r--client/src/app/videos/+video-watch/video-watch.module.ts34
-rw-r--r--client/src/app/videos/recommendations/recent-videos-recommendation.service.ts10
-rw-r--r--client/src/app/videos/recommendations/recommendation-info.model.ts (renamed from client/src/app/shared/video/recommendation-info.model.ts)0
-rw-r--r--client/src/app/videos/recommendations/recommendations.module.ts19
-rw-r--r--client/src/app/videos/recommendations/recommendations.service.ts4
-rw-r--r--client/src/app/videos/recommendations/recommended-videos.component.ts15
-rw-r--r--client/src/app/videos/recommendations/recommended-videos.store.ts12
-rw-r--r--client/src/app/videos/video-list/index.ts1
-rw-r--r--client/src/app/videos/video-list/overview/index.ts3
-rw-r--r--client/src/app/videos/video-list/overview/overview.service.ts (renamed from client/src/app/shared/overview/overview.service.ts)15
-rw-r--r--client/src/app/videos/video-list/overview/video-overview.component.html (renamed from client/src/app/videos/video-list/video-overview.component.html)0
-rw-r--r--client/src/app/videos/video-list/overview/video-overview.component.scss (renamed from client/src/app/videos/video-list/video-overview.component.scss)0
-rw-r--r--client/src/app/videos/video-list/overview/video-overview.component.ts (renamed from client/src/app/videos/video-list/video-overview.component.ts)10
-rw-r--r--client/src/app/videos/video-list/overview/videos-overview.model.ts (renamed from client/src/app/shared/overview/videos-overview.model.ts)4
-rw-r--r--client/src/app/videos/video-list/video-local.component.ts22
-rw-r--r--client/src/app/videos/video-list/video-most-liked.component.ts20
-rw-r--r--client/src/app/videos/video-list/video-recently-added.component.ts20
-rw-r--r--client/src/app/videos/video-list/video-trending.component.ts20
-rw-r--r--client/src/app/videos/video-list/video-user-subscriptions.component.ts25
-rw-r--r--client/src/app/videos/videos-routing.module.ts4
-rw-r--r--client/src/app/videos/videos.module.ts21
448 files changed, 2045 insertions, 2059 deletions
diff --git a/client/src/app/+about/about-follows/about-follows.component.ts b/client/src/app/+about/about-follows/about-follows.component.ts
index fc265fecb..17c6903b8 100644
--- a/client/src/app/+about/about-follows/about-follows.component.ts
+++ b/client/src/app/+about/about-follows/about-follows.component.ts
@@ -1,10 +1,8 @@
1import { Component, OnInit } from '@angular/core'
2import { FollowService } from '@app/shared/instance/follow.service'
3import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
4import { Notifier } from '@app/core'
5import { RestService } from '@app/shared'
6import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
7import { Subject } from 'rxjs' 2import { Subject } from 'rxjs'
3import { Component, OnInit } from '@angular/core'
4import { ComponentPagination, hasMoreItems, Notifier, RestService } from '@app/core'
5import { InstanceFollowService } from '@app/shared/shared-instance'
8 6
9@Component({ 7@Component({
10 selector: 'my-about-follows', 8 selector: 'my-about-follows',
@@ -38,7 +36,7 @@ export class AboutFollowsComponent implements OnInit {
38 constructor ( 36 constructor (
39 private restService: RestService, 37 private restService: RestService,
40 private notifier: Notifier, 38 private notifier: Notifier,
41 private followService: FollowService 39 private followService: InstanceFollowService
42 ) { } 40 ) { }
43 41
44 ngOnInit () { 42 ngOnInit () {
diff --git a/client/src/app/+about/about-instance/about-instance.component.ts b/client/src/app/+about/about-instance/about-instance.component.ts
index 15841be74..c57ac69ab 100644
--- a/client/src/app/+about/about-instance/about-instance.component.ts
+++ b/client/src/app/+about/about-instance/about-instance.component.ts
@@ -1,11 +1,11 @@
1import { Component, OnInit, ViewChild, AfterViewChecked } from '@angular/core' 1import { ViewportScroller } from '@angular/common'
2import { Notifier, ServerService } from '@app/core' 2import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core'
3import { ActivatedRoute } from '@angular/router'
3import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' 4import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component'
4import { InstanceService } from '@app/shared/instance/instance.service' 5import { ServerService } from '@app/core'
6import { InstanceService } from '@app/shared/shared-instance'
5import { ServerConfig } from '@shared/models' 7import { ServerConfig } from '@shared/models'
6import { ActivatedRoute } from '@angular/router'
7import { ResolverData } from './about-instance.resolver' 8import { ResolverData } from './about-instance.resolver'
8import { ViewportScroller } from '@angular/common'
9 9
10@Component({ 10@Component({
11 selector: 'my-about-instance', 11 selector: 'my-about-instance',
diff --git a/client/src/app/+about/about-instance/about-instance.resolver.ts b/client/src/app/+about/about-instance/about-instance.resolver.ts
index 94c6abe5a..b2349ba12 100644
--- a/client/src/app/+about/about-instance/about-instance.resolver.ts
+++ b/client/src/app/+about/about-instance/about-instance.resolver.ts
@@ -1,17 +1,16 @@
1import { forkJoin } from 'rxjs'
2import { map, switchMap } from 'rxjs/operators'
1import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
2import { ActivatedRouteSnapshot, Resolve } from '@angular/router' 4import { ActivatedRouteSnapshot, Resolve } from '@angular/router'
3import { map, switchMap } from 'rxjs/operators' 5import { InstanceService } from '@app/shared/shared-instance'
4import { forkJoin } from 'rxjs'
5import { InstanceService } from '@app/shared/instance/instance.service'
6import { About } from '@shared/models/server' 6import { About } from '@shared/models/server'
7 7
8export type ResolverData = { about: About, languages: string[], categories: string[] } 8export type ResolverData = { about: About, languages: string[], categories: string[] }
9 9
10@Injectable() 10@Injectable()
11export class AboutInstanceResolver implements Resolve<any> { 11export class AboutInstanceResolver implements Resolve<any> {
12 constructor ( 12
13 private instanceService: InstanceService 13 constructor (private instanceService: InstanceService) {}
14 ) {}
15 14
16 resolve (route: ActivatedRouteSnapshot) { 15 resolve (route: ActivatedRouteSnapshot) {
17 return this.instanceService.getAbout() 16 return this.instanceService.getAbout()
diff --git a/client/src/app/+about/about-instance/contact-admin-modal.component.ts b/client/src/app/+about/about-instance/contact-admin-modal.component.ts
index d5e146b82..5199402e6 100644
--- a/client/src/app/+about/about-instance/contact-admin-modal.component.ts
+++ b/client/src/app/+about/about-instance/contact-admin-modal.component.ts
@@ -1,11 +1,10 @@
1import { Component, OnInit, ViewChild } from '@angular/core' 1import { Component, OnInit, ViewChild } from '@angular/core'
2import { Notifier, ServerService } from '@app/core' 2import { Notifier, ServerService } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill' 3import { FormReactive, FormValidatorService, InstanceValidatorsService } from '@app/shared/shared-forms'
4import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 4import { InstanceService } from '@app/shared/shared-instance'
5import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 5import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
6import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 6import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
7import { FormReactive, InstanceValidatorsService } from '@app/shared' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { InstanceService } from '@app/shared/instance/instance.service'
9import { ServerConfig } from '@shared/models' 8import { ServerConfig } from '@shared/models'
10 9
11@Component({ 10@Component({
diff --git a/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts b/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts
index fa2c0daa0..da1fcdc92 100644
--- a/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts
+++ b/client/src/app/+about/about-peertube/about-peertube-contributors.component.ts
@@ -1,5 +1,5 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { MarkdownService } from '@app/shared/renderer' 2import { MarkdownService } from '@app/core'
3 3
4@Component({ 4@Component({
5 selector: 'my-about-peertube-contributors', 5 selector: 'my-about-peertube-contributors',
diff --git a/client/src/app/+about/about.module.ts b/client/src/app/+about/about.module.ts
index 84d697540..1aca14033 100644
--- a/client/src/app/+about/about.module.ts
+++ b/client/src/app/+about/about.module.ts
@@ -1,18 +1,25 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { AboutRoutingModule } from './about-routing.module' 2import { AboutFollowsComponent } from '@app/+about/about-follows/about-follows.component'
3import { AboutComponent } from './about.component'
4import { SharedModule } from '../shared'
5import { AboutInstanceComponent } from '@app/+about/about-instance/about-instance.component' 3import { AboutInstanceComponent } from '@app/+about/about-instance/about-instance.component'
6import { AboutPeertubeComponent } from '@app/+about/about-peertube/about-peertube.component' 4import { AboutInstanceResolver } from '@app/+about/about-instance/about-instance.resolver'
7import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component' 5import { ContactAdminModalComponent } from '@app/+about/about-instance/contact-admin-modal.component'
8import { AboutFollowsComponent } from '@app/+about/about-follows/about-follows.component'
9import { AboutPeertubeContributorsComponent } from '@app/+about/about-peertube/about-peertube-contributors.component' 6import { AboutPeertubeContributorsComponent } from '@app/+about/about-peertube/about-peertube-contributors.component'
10import { AboutInstanceResolver } from '@app/+about/about-instance/about-instance.resolver' 7import { AboutPeertubeComponent } from '@app/+about/about-peertube/about-peertube.component'
8import { SharedFormModule } from '@app/shared/shared-forms'
9import { SharedGlobalIconModule } from '@app/shared/shared-icons'
10import { SharedInstanceModule } from '@app/shared/shared-instance'
11import { SharedMainModule } from '@app/shared/shared-main'
12import { AboutRoutingModule } from './about-routing.module'
13import { AboutComponent } from './about.component'
11 14
12@NgModule({ 15@NgModule({
13 imports: [ 16 imports: [
14 AboutRoutingModule, 17 AboutRoutingModule,
15 SharedModule 18
19 SharedMainModule,
20 SharedFormModule,
21 SharedInstanceModule,
22 SharedGlobalIconModule
16 ], 23 ],
17 24
18 declarations: [ 25 declarations: [
diff --git a/client/src/app/+accounts/account-about/account-about.component.ts b/client/src/app/+accounts/account-about/account-about.component.ts
index d1616490f..8c01e4007 100644
--- a/client/src/app/+accounts/account-about/account-about.component.ts
+++ b/client/src/app/+accounts/account-about/account-about.component.ts
@@ -1,9 +1,8 @@
1import { Subscription } from 'rxjs'
1import { Component, OnDestroy, OnInit } from '@angular/core' 2import { Component, OnDestroy, OnInit } from '@angular/core'
2import { Account } from '@app/shared/account/account.model' 3import { MarkdownService } from '@app/core'
3import { AccountService } from '@app/shared/account/account.service' 4import { Account, AccountService } from '@app/shared/shared-main'
4import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
5import { Subscription } from 'rxjs'
6import { MarkdownService } from '@app/shared/renderer'
7 6
8@Component({ 7@Component({
9 selector: 'my-account-about', 8 selector: 'my-account-about',
diff --git a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
index eba1acfa1..205245675 100644
--- a/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
+++ b/client/src/app/+accounts/account-video-channels/account-video-channels.component.ts
@@ -1,16 +1,9 @@
1import { from, Subject, Subscription } from 'rxjs' 1import { from, Subject, Subscription } from 'rxjs'
2import { concatMap, map, switchMap, tap } from 'rxjs/operators' 2import { concatMap, map, switchMap, tap } from 'rxjs/operators'
3import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit } from '@angular/core'
4import { User, UserService } from '@app/shared' 4import { ComponentPagination, hasMoreItems, ScreenService, User, UserService } from '@app/core'
5import { Account } from '@app/shared/account/account.model' 5import { Account, AccountService, Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
6import { AccountService } from '@app/shared/account/account.service' 6import { VideoSortField } from '@shared/models'
7import { ScreenService } from '@app/shared/misc/screen.service'
8import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
9import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
10import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
11import { VideoSortField } from '@app/shared/video/sort-field.type'
12import { Video } from '@app/shared/video/video.model'
13import { VideoService } from '@app/shared/video/video.service'
14 7
15@Component({ 8@Component({
16 selector: 'my-account-video-channels', 9 selector: 'my-account-video-channels',
diff --git a/client/src/app/+accounts/account-videos/account-videos.component.ts b/client/src/app/+accounts/account-videos/account-videos.component.ts
index 41b27b541..dd47589c1 100644
--- a/client/src/app/+accounts/account-videos/account-videos.component.ts
+++ b/client/src/app/+accounts/account-videos/account-videos.component.ts
@@ -1,25 +1,18 @@
1import { Subscription } from 'rxjs'
2import { first, tap } from 'rxjs/operators'
1import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils' 5import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
4import { AuthService } from '../../core/auth' 6import { immutableAssign } from '@app/helpers'
5import { ConfirmService } from '../../core/confirm' 7import { Account, AccountService, VideoService } from '@app/shared/shared-main'
6import { AbstractVideoList } from '../../shared/video/abstract-video-list' 8import { AbstractVideoList } from '@app/shared/shared-video-miniature'
7import { VideoService } from '../../shared/video/video.service'
8import { Account } from '@app/shared/account/account.model'
9import { AccountService } from '@app/shared/account/account.service'
10import { first, tap } from 'rxjs/operators'
11import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
12import { Subscription } from 'rxjs'
13import { ScreenService } from '@app/shared/misc/screen.service'
14import { Notifier, ServerService } from '@app/core'
15import { UserService } from '@app/shared'
16import { LocalStorageService } from '@app/shared/misc/storage.service'
17 10
18@Component({ 11@Component({
19 selector: 'my-account-videos', 12 selector: 'my-account-videos',
20 templateUrl: '../../shared/video/abstract-video-list.html', 13 templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html',
21 styleUrls: [ 14 styleUrls: [
22 '../../shared/video/abstract-video-list.scss', 15 '../../shared/shared-video-miniature/abstract-video-list.scss',
23 './account-videos.component.scss' 16 './account-videos.component.scss'
24 ] 17 ]
25}) 18})
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts
index bf71179f3..01911cac2 100644
--- a/client/src/app/+accounts/accounts.component.ts
+++ b/client/src/app/+accounts/accounts.component.ts
@@ -1,17 +1,11 @@
1import { Subscription } from 'rxjs'
2import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators'
1import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute } from '@angular/router' 4import { ActivatedRoute } from '@angular/router'
3import { AccountService } from '@app/shared/account/account.service' 5import { AuthService, Notifier, RedirectService, RestExtractor, ScreenService, UserService } from '@app/core'
4import { Account } from '@app/shared/account/account.model' 6import { Account, AccountService, ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main'
5import { RestExtractor, UserService } from '@app/shared'
6import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators'
7import { Subscription } from 'rxjs'
8import { AuthService, Notifier, RedirectService } from '@app/core'
9import { User, UserRight } from '../../../../shared'
10import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
11import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 8import { User, UserRight } from '@shared/models'
12import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
13import { ListOverflowItem } from '@app/shared/misc/list-overflow.component'
14import { ScreenService } from '@app/shared/misc/screen.service'
15 9
16@Component({ 10@Component({
17 templateUrl: './accounts.component.html', 11 templateUrl: './accounts.component.html',
diff --git a/client/src/app/+accounts/accounts.module.ts b/client/src/app/+accounts/accounts.module.ts
index 8e679822a..815360341 100644
--- a/client/src/app/+accounts/accounts.module.ts
+++ b/client/src/app/+accounts/accounts.module.ts
@@ -1,15 +1,26 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { SharedModule } from '../shared' 2import { SharedFormModule } from '@app/shared/shared-forms'
3import { AccountsRoutingModule } from './accounts-routing.module' 3import { SharedGlobalIconModule } from '@app/shared/shared-icons'
4import { AccountsComponent } from './accounts.component' 4import { SharedMainModule } from '@app/shared/shared-main'
5import { AccountVideosComponent } from './account-videos/account-videos.component' 5import { SharedModerationModule } from '@app/shared/shared-moderation'
6import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription'
7import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
6import { AccountAboutComponent } from './account-about/account-about.component' 8import { AccountAboutComponent } from './account-about/account-about.component'
7import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component' 9import { AccountVideoChannelsComponent } from './account-video-channels/account-video-channels.component'
10import { AccountVideosComponent } from './account-videos/account-videos.component'
11import { AccountsRoutingModule } from './accounts-routing.module'
12import { AccountsComponent } from './accounts.component'
8 13
9@NgModule({ 14@NgModule({
10 imports: [ 15 imports: [
11 AccountsRoutingModule, 16 AccountsRoutingModule,
12 SharedModule 17
18 SharedMainModule,
19 SharedFormModule,
20 SharedUserSubscriptionModule,
21 SharedModerationModule,
22 SharedVideoMiniatureModule,
23 SharedGlobalIconModule
13 ], 24 ],
14 25
15 declarations: [ 26 declarations: [
diff --git a/client/src/app/+admin/admin-routing.module.ts b/client/src/app/+admin/admin-routing.module.ts
index 79c57221b..986dae8eb 100644
--- a/client/src/app/+admin/admin-routing.module.ts
+++ b/client/src/app/+admin/admin-routing.module.ts
@@ -1,15 +1,13 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3import { ConfigRoutes } from '@app/+admin/config' 3import { ConfigRoutes } from '@app/+admin/config'
4 4import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes'
5import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes'
6import { SystemRoutes } from '@app/+admin/system'
5import { MetaGuard } from '@ngx-meta/core' 7import { MetaGuard } from '@ngx-meta/core'
6
7import { AdminComponent } from './admin.component' 8import { AdminComponent } from './admin.component'
8import { FollowsRoutes } from './follows' 9import { FollowsRoutes } from './follows'
9import { UsersRoutes } from './users' 10import { UsersRoutes } from './users'
10import { ModerationRoutes } from '@app/+admin/moderation/moderation.routes'
11import { SystemRoutes } from '@app/+admin/system'
12import { PluginsRoutes } from '@app/+admin/plugins/plugins.routes'
13 11
14const adminRoutes: Routes = [ 12const adminRoutes: Routes = [
15 { 13 {
diff --git a/client/src/app/+admin/admin.component.ts b/client/src/app/+admin/admin.component.ts
index a97a33cf5..e47c7a8f4 100644
--- a/client/src/app/+admin/admin.component.ts
+++ b/client/src/app/+admin/admin.component.ts
@@ -1,8 +1,8 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { UserRight } from '../../../../shared' 2import { AuthService } from '@app/core'
3import { AuthService } from '../core/auth/auth.service' 3import { ListOverflowItem } from '@app/shared/shared-main'
4import { ListOverflowItem } from '@app/shared/misc/list-overflow.component'
5import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { UserRight } from '@shared/models'
6 6
7@Component({ 7@Component({
8 templateUrl: './admin.component.html' 8 templateUrl: './admin.component.html'
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts
index eccec8a49..728227a84 100644
--- a/client/src/app/+admin/admin.module.ts
+++ b/client/src/app/+admin/admin.module.ts
@@ -1,39 +1,41 @@
1import { NgModule } from '@angular/core' 1import { ChartModule } from 'primeng/chart'
2import { ConfigComponent, EditCustomConfigComponent } from '@app/+admin/config' 2import { SelectButtonModule } from 'primeng/selectbutton'
3import { ConfigService } from '@app/+admin/config/shared/config.service'
4import { TableModule } from 'primeng/table' 3import { TableModule } from 'primeng/table'
5import { SharedModule } from '../shared' 4import { NgModule } from '@angular/core'
5import { SharedFormModule } from '@app/shared/shared-forms'
6import { SharedGlobalIconModule } from '@app/shared/shared-icons'
7import { SharedMainModule } from '@app/shared/shared-main'
8import { SharedModerationModule } from '@app/shared/shared-moderation'
6import { AdminRoutingModule } from './admin-routing.module' 9import { AdminRoutingModule } from './admin-routing.module'
7import { AdminComponent } from './admin.component' 10import { AdminComponent } from './admin.component'
11import { ConfigComponent, EditCustomConfigComponent } from './config'
12import { ConfigService } from './config/shared/config.service'
8import { FollowersListComponent, FollowsComponent, VideoRedundanciesListComponent } from './follows' 13import { FollowersListComponent, FollowsComponent, VideoRedundanciesListComponent } from './follows'
9import { FollowingListComponent } from './follows/following-list/following-list.component' 14import { FollowingListComponent } from './follows/following-list/following-list.component'
10import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users' 15import { RedundancyCheckboxComponent } from './follows/shared/redundancy-checkbox.component'
11import { 16import { VideoRedundancyInformationComponent } from './follows/video-redundancies-list/video-redundancy-information.component'
12 ModerationCommentModalComponent, 17import { ModerationCommentModalComponent, VideoAbuseListComponent, VideoBlockListComponent } from './moderation'
13 VideoAbuseListComponent, 18import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from './moderation/instance-blocklist'
14 VideoBlockListComponent 19import { ModerationComponent } from './moderation/moderation.component'
15} from './moderation'
16import { ModerationComponent } from '@app/+admin/moderation/moderation.component'
17import { RedundancyCheckboxComponent } from '@app/+admin/follows/shared/redundancy-checkbox.component'
18import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist'
19import { JobsComponent } from '@app/+admin/system/jobs/jobs.component'
20import { JobService, LogsComponent, LogsService, SystemComponent } from '@app/+admin/system'
21import { DebugComponent, DebugService } from '@app/+admin/system/debug'
22import { PluginsComponent } from '@app/+admin/plugins/plugins.component'
23import { PluginListInstalledComponent } from '@app/+admin/plugins/plugin-list-installed/plugin-list-installed.component'
24import { PluginSearchComponent } from '@app/+admin/plugins/plugin-search/plugin-search.component'
25import { PluginShowInstalledComponent } from '@app/+admin/plugins/plugin-show-installed/plugin-show-installed.component'
26import { SelectButtonModule } from 'primeng/selectbutton'
27import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
28import { VideoRedundancyInformationComponent } from '@app/+admin/follows/video-redundancies-list/video-redundancy-information.component'
29import { ChartModule } from 'primeng/chart'
30import { VideoAbuseDetailsComponent } from './moderation/video-abuse-list/video-abuse-details.component' 20import { VideoAbuseDetailsComponent } from './moderation/video-abuse-list/video-abuse-details.component'
21import { PluginListInstalledComponent } from './plugins/plugin-list-installed/plugin-list-installed.component'
22import { PluginSearchComponent } from './plugins/plugin-search/plugin-search.component'
23import { PluginShowInstalledComponent } from './plugins/plugin-show-installed/plugin-show-installed.component'
24import { PluginsComponent } from './plugins/plugins.component'
25import { PluginApiService } from './plugins/shared/plugin-api.service'
26import { JobService, LogsComponent, LogsService, SystemComponent } from './system'
27import { DebugComponent, DebugService } from './system/debug'
28import { JobsComponent } from './system/jobs/jobs.component'
29import { UserCreateComponent, UserListComponent, UserPasswordComponent, UsersComponent, UserUpdateComponent } from './users'
31 30
32@NgModule({ 31@NgModule({
33 imports: [ 32 imports: [
34 AdminRoutingModule, 33 AdminRoutingModule,
35 34
36 SharedModule, 35 SharedMainModule,
36 SharedFormModule,
37 SharedModerationModule,
38 SharedGlobalIconModule,
37 39
38 TableModule, 40 TableModule,
39 SelectButtonModule, 41 SelectButtonModule,
diff --git a/client/src/app/+admin/config/config.routes.ts b/client/src/app/+admin/config/config.routes.ts
index 2ca2f8fde..7c1a1a166 100644
--- a/client/src/app/+admin/config/config.routes.ts
+++ b/client/src/app/+admin/config/config.routes.ts
@@ -1,7 +1,7 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config' 2import { EditCustomConfigComponent } from '@app/+admin/config/edit-custom-config'
3import { UserRightGuard } from '@app/core' 3import { UserRightGuard } from '@app/core'
4import { UserRight } from '../../../../../shared/models/users' 4import { UserRight } from '@shared/models'
5import { ConfigComponent } from './config.component' 5import { ConfigComponent } from './config.component'
6 6
7export const ConfigRoutes: Routes = [ 7export const ConfigRoutes: Routes = [
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
index 3a47ba25e..69629770f 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
+++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
@@ -1,16 +1,14 @@
1import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core'
2import { ConfigService } from '@app/+admin/config/shared/config.service'
3import { ServerService } from '@app/core/server/server.service'
4import { CustomConfigValidatorsService, FormReactive, UserValidatorsService } from '@app/shared'
5import { Notifier } from '@app/core'
6import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
9import { SelectItem } from 'primeng/api' 1import { SelectItem } from 'primeng/api'
10import { forkJoin } from 'rxjs' 2import { forkJoin } from 'rxjs'
11import { ServerConfig } from '@shared/models'
12import { ViewportScroller } from '@angular/common' 3import { ViewportScroller } from '@angular/common'
4import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core'
5import { ConfigService } from '@app/+admin/config/shared/config.service'
6import { Notifier } from '@app/core'
7import { ServerService } from '@app/core/server/server.service'
8import { CustomConfigValidatorsService, FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
13import { NgbNav } from '@ng-bootstrap/ng-bootstrap' 9import { NgbNav } from '@ng-bootstrap/ng-bootstrap'
10import { I18n } from '@ngx-translate/i18n-polyfill'
11import { CustomConfig, ServerConfig } from '@shared/models'
14 12
15@Component({ 13@Component({
16 selector: 'my-edit-custom-config', 14 selector: 'my-edit-custom-config',
diff --git a/client/src/app/+admin/config/shared/config.service.ts b/client/src/app/+admin/config/shared/config.service.ts
index 874b8094d..f182946b8 100644
--- a/client/src/app/+admin/config/shared/config.service.ts
+++ b/client/src/app/+admin/config/shared/config.service.ts
@@ -1,10 +1,10 @@
1import { catchError } from 'rxjs/operators' 1import { catchError } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 2import { HttpClient } from '@angular/common/http'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { CustomConfig } from '../../../../../../shared/models/server/custom-config.model' 4import { RestExtractor } from '@app/core'
5import { environment } from '../../../../environments/environment'
6import { RestExtractor } from '../../../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { CustomConfig } from '@shared/models'
7import { environment } from '../../../../environments/environment'
8 8
9@Injectable() 9@Injectable()
10export class ConfigService { 10export class ConfigService {
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
index 17352a601..63135f898 100644
--- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
@@ -1,10 +1,9 @@
1import { Component, OnInit } from '@angular/core'
2import { ConfirmService, Notifier } from '@app/core'
3import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
4import { ActorFollow } from '../../../../../../shared/models/actors/follow.model' 2import { Component, OnInit } from '@angular/core'
5import { RestPagination, RestTable } from '../../../shared' 3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
6import { FollowService } from '@app/shared/instance/follow.service' 4import { InstanceFollowService } from '@app/shared/shared-instance'
7import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { ActorFollow } from '@shared/models'
8 7
9@Component({ 8@Component({
10 selector: 'my-followers-list', 9 selector: 'my-followers-list',
@@ -21,7 +20,7 @@ export class FollowersListComponent extends RestTable implements OnInit {
21 private confirmService: ConfirmService, 20 private confirmService: ConfirmService,
22 private notifier: Notifier, 21 private notifier: Notifier,
23 private i18n: I18n, 22 private i18n: I18n,
24 private followService: FollowService 23 private followService: InstanceFollowService
25 ) { 24 ) {
26 super() 25 super()
27 } 26 }
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts
index 6ddbf02d6..dae8923b5 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.ts
+++ b/client/src/app/+admin/follows/following-list/following-list.component.ts
@@ -1,12 +1,10 @@
1import { Component, OnInit, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core'
3import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
4import { ActorFollow } from '../../../../../../shared/models/actors/follow.model' 2import { Component, OnInit, ViewChild } from '@angular/core'
5import { ConfirmService } from '../../../core/confirm/confirm.service' 3import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
6import { RestPagination, RestTable } from '../../../shared' 4import { InstanceFollowService } from '@app/shared/shared-instance'
7import { FollowService } from '@app/shared/instance/follow.service' 5import { BatchDomainsModalComponent } from '@app/shared/shared-moderation'
8import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
9import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-domains-modal.component' 7import { ActorFollow } from '@shared/models'
10 8
11@Component({ 9@Component({
12 selector: 'my-followers-list', 10 selector: 'my-followers-list',
@@ -24,7 +22,7 @@ export class FollowingListComponent extends RestTable implements OnInit {
24 constructor ( 22 constructor (
25 private notifier: Notifier, 23 private notifier: Notifier,
26 private confirmService: ConfirmService, 24 private confirmService: ConfirmService,
27 private followService: FollowService, 25 private followService: InstanceFollowService,
28 private i18n: I18n 26 private i18n: I18n
29 ) { 27 ) {
30 super() 28 super()
diff --git a/client/src/app/+admin/follows/follows.routes.ts b/client/src/app/+admin/follows/follows.routes.ts
index 8270ae444..817074536 100644
--- a/client/src/app/+admin/follows/follows.routes.ts
+++ b/client/src/app/+admin/follows/follows.routes.ts
@@ -1,11 +1,10 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2 2import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list'
3import { UserRightGuard } from '../../core' 3import { UserRightGuard } from '@app/core'
4import { FollowsComponent } from './follows.component' 4import { UserRight } from '@shared/models'
5import { FollowersListComponent } from './followers-list' 5import { FollowersListComponent } from './followers-list'
6import { UserRight } from '../../../../../shared'
7import { FollowingListComponent } from './following-list/following-list.component' 6import { FollowingListComponent } from './following-list/following-list.component'
8import { VideoRedundanciesListComponent } from '@app/+admin/follows/video-redundancies-list' 7import { FollowsComponent } from './follows.component'
9 8
10export const FollowsRoutes: Routes = [ 9export const FollowsRoutes: Routes = [
11 { 10 {
diff --git a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
index 9d7883d97..662143abc 100644
--- a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
+++ b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts
@@ -1,7 +1,7 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier } from '@app/core'
3import { RedundancyService } from '@app/shared/shared-main'
3import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
4import { RedundancyService } from '@app/shared/video/redundancy.service'
5 5
6@Component({ 6@Component({
7 selector: 'my-redundancy-checkbox', 7 selector: 'my-redundancy-checkbox',
diff --git a/client/src/app/+admin/follows/video-redundancies-list/index.ts b/client/src/app/+admin/follows/video-redundancies-list/index.ts
index 6a7c7f483..07e734b1a 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/index.ts
+++ b/client/src/app/+admin/follows/video-redundancies-list/index.ts
@@ -1 +1,2 @@
1export * from './video-redundancies-list.component' 1export * from './video-redundancies-list.component'
2export * from './video-redundancy-information.component'
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
index 267a1f58e..0048882bc 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
+++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
@@ -1,14 +1,12 @@
1import { Component, OnInit } from '@angular/core' 1import { BytesPipe } from 'ngx-pipes'
2import { Notifier, ServerService } from '@app/core'
3import { SortMeta } from 'primeng/api' 2import { SortMeta } from 'primeng/api'
4import { ConfirmService } from '../../../core/confirm/confirm.service' 3import { Component, OnInit } from '@angular/core'
5import { RestPagination, RestTable } from '../../../shared' 4import { ConfirmService, Notifier, RestPagination, RestTable, ServerService } from '@app/core'
5import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage'
6import { RedundancyService } from '@app/shared/shared-main'
6import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
7import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' 8import { VideoRedundanciesTarget, VideoRedundancy } from '@shared/models'
8import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage'
9import { VideosRedundancyStats } from '@shared/models/server' 9import { VideosRedundancyStats } from '@shared/models/server'
10import { BytesPipe } from 'ngx-pipes'
11import { RedundancyService } from '@app/shared/video/redundancy.service'
12 10
13@Component({ 11@Component({
14 selector: 'my-video-redundancies-list', 12 selector: 'my-video-redundancies-list',
diff --git a/client/src/app/+admin/moderation/index.ts b/client/src/app/+admin/moderation/index.ts
index e99244b74..16249236c 100644
--- a/client/src/app/+admin/moderation/index.ts
+++ b/client/src/app/+admin/moderation/index.ts
@@ -1,3 +1,4 @@
1export * from './instance-blocklist'
1export * from './video-abuse-list' 2export * from './video-abuse-list'
2export * from './video-block-list' 3export * from './video-block-list'
3export * from './moderation.component' 4export * from './moderation.component'
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts
index 90a176194..d9fec29ce 100644
--- a/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts
+++ b/client/src/app/+admin/moderation/instance-blocklist/instance-account-blocklist.component.ts
@@ -1,10 +1,10 @@
1import { Component } from '@angular/core' 1import { Component } from '@angular/core'
2import { GenericAccountBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' 2import { BlocklistComponentType, GenericAccountBlocklistComponent } from '@app/shared/shared-moderation'
3 3
4@Component({ 4@Component({
5 selector: 'my-instance-account-blocklist', 5 selector: 'my-instance-account-blocklist',
6 styleUrls: [ '../moderation.component.scss', '../../../shared/blocklist/account-blocklist.component.scss' ], 6 styleUrls: [ '../moderation.component.scss', '../../../shared/shared-moderation/account-blocklist.component.scss' ],
7 templateUrl: '../../../shared/blocklist/account-blocklist.component.html' 7 templateUrl: '../../../shared/shared-moderation/account-blocklist.component.html'
8}) 8})
9export class InstanceAccountBlocklistComponent extends GenericAccountBlocklistComponent { 9export class InstanceAccountBlocklistComponent extends GenericAccountBlocklistComponent {
10 mode = BlocklistComponentType.Instance 10 mode = BlocklistComponentType.Instance
diff --git a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts
index 9d4ec174a..3afae529f 100644
--- a/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts
+++ b/client/src/app/+admin/moderation/instance-blocklist/instance-server-blocklist.component.ts
@@ -1,10 +1,10 @@
1import { Component } from '@angular/core' 1import { Component } from '@angular/core'
2import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' 2import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/shared-moderation'
3 3
4@Component({ 4@Component({
5 selector: 'my-instance-server-blocklist', 5 selector: 'my-instance-server-blocklist',
6 styleUrls: [ '../../../shared/blocklist/server-blocklist.component.scss' ], 6 styleUrls: [ '../../../shared/shared-moderation/server-blocklist.component.scss' ],
7 templateUrl: '../../../shared/blocklist/server-blocklist.component.html' 7 templateUrl: '../../../shared/shared-moderation/server-blocklist.component.html'
8}) 8})
9export class InstanceServerBlocklistComponent extends GenericServerBlocklistComponent { 9export class InstanceServerBlocklistComponent extends GenericServerBlocklistComponent {
10 mode = BlocklistComponentType.Instance 10 mode = BlocklistComponentType.Instance
diff --git a/client/src/app/+admin/moderation/moderation.component.ts b/client/src/app/+admin/moderation/moderation.component.ts
index 1b1df6f09..806f9d100 100644
--- a/client/src/app/+admin/moderation/moderation.component.ts
+++ b/client/src/app/+admin/moderation/moderation.component.ts
@@ -1,6 +1,6 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { UserRight } from '../../../../../shared'
3import { AuthService, ServerService } from '@app/core' 2import { AuthService, ServerService } from '@app/core'
3import { UserRight } from '@shared/models'
4 4
5@Component({ 5@Component({
6 templateUrl: './moderation.component.html', 6 templateUrl: './moderation.component.html',
diff --git a/client/src/app/+admin/moderation/moderation.routes.ts b/client/src/app/+admin/moderation/moderation.routes.ts
index c08333f17..cd837bcb9 100644
--- a/client/src/app/+admin/moderation/moderation.routes.ts
+++ b/client/src/app/+admin/moderation/moderation.routes.ts
@@ -1,10 +1,10 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { UserRight } from '../../../../../shared' 2import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist'
3import { UserRightGuard } from '@app/core' 3import { ModerationComponent } from '@app/+admin/moderation/moderation.component'
4import { VideoAbuseListComponent } from '@app/+admin/moderation/video-abuse-list' 4import { VideoAbuseListComponent } from '@app/+admin/moderation/video-abuse-list'
5import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list' 5import { VideoBlockListComponent } from '@app/+admin/moderation/video-block-list'
6import { ModerationComponent } from '@app/+admin/moderation/moderation.component' 6import { UserRightGuard } from '@app/core'
7import { InstanceAccountBlocklistComponent, InstanceServerBlocklistComponent } from '@app/+admin/moderation/instance-blocklist' 7import { UserRight } from '@shared/models'
8 8
9export const ModerationRoutes: Routes = [ 9export const ModerationRoutes: Routes = [
10 { 10 {
diff --git a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts
index a0471f2b0..3cd763ca4 100644
--- a/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts
+++ b/client/src/app/+admin/moderation/video-abuse-list/moderation-comment-modal.component.ts
@@ -1,11 +1,11 @@
1import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier } from '@app/core'
3import { FormReactive, VideoAbuseService, VideoAbuseValidatorsService } from '../../../shared' 3import { FormReactive, FormValidatorService, VideoAbuseValidatorsService } from '@app/shared/shared-forms'
4import { I18n } from '@ngx-translate/i18n-polyfill' 4import { VideoAbuseService } from '@app/shared/shared-moderation'
5import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 5import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
6import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 6import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
7import { FormValidatorService } from '../../../shared/forms/form-validators/form-validator.service' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { VideoAbuse } from '../../../../../../shared/models/videos' 8import { VideoAbuse } from '@shared/models'
9 9
10@Component({ 10@Component({
11 selector: 'my-moderation-comment-modal', 11 selector: 'my-moderation-comment-modal',
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts
index 13485124f..9aa70288d 100644
--- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts
+++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-details.component.ts
@@ -1,9 +1,8 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { Actor } from '@app/shared/actor/actor.model' 2import { Actor } from '@app/shared/shared-main'
3import { I18n } from '@ngx-translate/i18n-polyfill'
3import { VideoAbusePredefinedReasonsString } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model' 4import { VideoAbusePredefinedReasonsString } from '../../../../../../shared/models/videos/abuse/video-abuse-reason.model'
4import { ProcessedVideoAbuse } from './video-abuse-list.component' 5import { ProcessedVideoAbuse } from './video-abuse-list.component'
5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { durationToString } from '@app/shared/misc/utils'
7 6
8@Component({ 7@Component({
9 selector: 'my-video-abuse-details', 8 selector: 'my-video-abuse-details',
diff --git a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
index d7f5beef3..b0a655e71 100644
--- a/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
+++ b/client/src/app/+admin/moderation/video-abuse-list/video-abuse-list.component.ts
@@ -1,23 +1,16 @@
1import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core'
2import { Account } from '@app/shared/account/account.model'
3import { Notifier } from '@app/core'
4import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
5import { VideoAbuse, VideoAbuseState } from '../../../../../../shared' 2import { filter } from 'rxjs/operators'
6import { RestPagination, RestTable, VideoAbuseService, VideoBlockService } from '../../../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { DropdownAction } from '../../../shared/buttons/action-dropdown.component'
9import { ConfirmService } from '../../../core/index'
10import { ModerationCommentModalComponent } from './moderation-comment-modal.component'
11import { Video } from '../../../shared/video/video.model'
12import { MarkdownService } from '@app/shared/renderer'
13import { Actor } from '@app/shared/actor/actor.model'
14import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' 3import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils'
4import { environment } from 'src/environments/environment'
5import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core'
15import { DomSanitizer } from '@angular/platform-browser' 6import { DomSanitizer } from '@angular/platform-browser'
16import { BlocklistService } from '@app/shared/blocklist'
17import { VideoService } from '@app/shared/video/video.service'
18import { ActivatedRoute, Params, Router } from '@angular/router' 7import { ActivatedRoute, Params, Router } from '@angular/router'
19import { filter } from 'rxjs/operators' 8import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable } from '@app/core'
20import { environment } from 'src/environments/environment' 9import { Account, Actor, DropdownAction, Video, VideoService } from '@app/shared/shared-main'
10import { BlocklistService, VideoAbuseService, VideoBlockService } from '@app/shared/shared-moderation'
11import { I18n } from '@ngx-translate/i18n-polyfill'
12import { VideoAbuse, VideoAbuseState } from '@shared/models'
13import { ModerationCommentModalComponent } from './moderation-comment-modal.component'
21 14
22export type ProcessedVideoAbuse = VideoAbuse & { 15export type ProcessedVideoAbuse = VideoAbuse & {
23 moderationCommentHtml?: string, 16 moderationCommentHtml?: string,
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
index c0ac32242..c03f9248e 100644
--- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
+++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
@@ -1,16 +1,12 @@
1import { Component, OnInit, AfterViewInit } from '@angular/core'
2import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
3import { Notifier, ServerService } from '@app/core'
4import { ConfirmService } from '../../../core'
5import { RestPagination, RestTable, VideoBlockService } from '../../../shared'
6import { VideoBlacklist, VideoBlacklistType } from '../../../../../../shared'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { DropdownAction } from '../../../shared/buttons/action-dropdown.component'
9import { Video } from '../../../shared/video/video.model'
10import { MarkdownService } from '@app/shared/renderer'
11import { Params, ActivatedRoute, Router } from '@angular/router'
12import { filter, switchMap } from 'rxjs/operators' 2import { filter, switchMap } from 'rxjs/operators'
13import { VideoService } from '@app/shared/video/video.service' 3import { AfterViewInit, Component, OnInit } from '@angular/core'
4import { ActivatedRoute, Params, Router } from '@angular/router'
5import { ConfirmService, MarkdownService, Notifier, RestPagination, RestTable, ServerService } from '@app/core'
6import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
7import { VideoBlockService } from '@app/shared/shared-moderation'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { VideoBlacklist, VideoBlacklistType } from '@shared/models'
14 10
15@Component({ 11@Component({
16 selector: 'my-video-block-list', 12 selector: 'my-video-block-list',
diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
index a8973f2b2..af31f1144 100644
--- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
+++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts
@@ -1,14 +1,13 @@
1import { Subject } from 'rxjs'
1import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
2import { PluginType } from '@shared/models/plugins/plugin.type'
3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
5import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
6import { ConfirmService, Notifier } from '@app/core'
7import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model'
8import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
9import { compareSemVer } from '@shared/core-utils/miscs/miscs' 4import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
5import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core'
10import { PluginService } from '@app/core/plugins/plugin.service' 6import { PluginService } from '@app/core/plugins/plugin.service'
11import { Subject } from 'rxjs' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { compareSemVer } from '@shared/core-utils/miscs/miscs'
9import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model'
10import { PluginType } from '@shared/models/plugins/plugin.type'
12 11
13@Component({ 12@Component({
14 selector: 'my-plugin-list-installed', 13 selector: 'my-plugin-list-installed',
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
index dc59e759b..ccf9f1ed5 100644
--- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
+++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts
@@ -1,14 +1,12 @@
1import { Subject } from 'rxjs'
2import { debounceTime, distinctUntilChanged } from 'rxjs/operators'
1import { Component, OnInit } from '@angular/core' 3import { Component, OnInit } from '@angular/core'
2import { Notifier, ServerService } from '@app/core'
3import { ConfirmService } from '../../../core'
4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { PluginType } from '@shared/models/plugins/plugin.type'
6import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
7import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
8import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
5import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
6import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, ServerService } from '@app/core'
7import { I18n } from '@ngx-translate/i18n-polyfill'
9import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' 8import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model'
10import { Subject } from 'rxjs' 9import { PluginType } from '@shared/models/plugins/plugin.type'
11import { debounceTime, distinctUntilChanged } from 'rxjs/operators'
12 10
13@Component({ 11@Component({
14 selector: 'my-plugin-search', 12 selector: 'my-plugin-search',
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
index 13d12b145..dde03f1da 100644
--- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
+++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts
@@ -1,13 +1,12 @@
1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model'
3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service'
5import { Notifier } from '@app/core'
6import { ActivatedRoute } from '@angular/router'
7import { Subscription } from 'rxjs' 1import { Subscription } from 'rxjs'
8import { map, switchMap } from 'rxjs/operators' 2import { map, switchMap } from 'rxjs/operators'
9import { BuildFormArgument, FormReactive, FormValidatorService } from '@app/shared' 3import { Component, OnDestroy, OnInit } from '@angular/core'
10import { RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model' 4import { ActivatedRoute } from '@angular/router'
5import { Notifier } from '@app/core'
6import { BuildFormArgument, FormReactive, FormValidatorService } from '@app/shared/shared-forms'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { PeerTubePlugin, RegisterServerSettingOptions } from '@shared/models'
9import { PluginApiService } from '../shared/plugin-api.service'
11 10
12@Component({ 11@Component({
13 selector: 'my-plugin-show-installed', 12 selector: 'my-plugin-show-installed',
diff --git a/client/src/app/+admin/plugins/shared/plugin-api.service.ts b/client/src/app/+admin/plugins/shared/plugin-api.service.ts
index f6ef68e9c..bf9129e01 100644
--- a/client/src/app/+admin/plugins/shared/plugin-api.service.ts
+++ b/client/src/app/+admin/plugins/shared/plugin-api.service.ts
@@ -1,19 +1,21 @@
1import { Observable } from 'rxjs'
1import { catchError, map, switchMap } from 'rxjs/operators' 2import { catchError, map, switchMap } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { environment } from '../../../../environments/environment' 5import { ComponentPagination, RestExtractor, RestService } from '@app/core'
5import { RestExtractor, RestService } from '../../../shared'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { PluginType } from '@shared/models/plugins/plugin.type'
8import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
9import { peertubeTranslate, ResultList } from '@shared/models'
10import { PeerTubePlugin } from '@shared/models/plugins/peertube-plugin.model'
11import { ManagePlugin } from '@shared/models/plugins/manage-plugin.model'
12import { InstallOrUpdatePlugin } from '@shared/models/plugins/install-plugin.model'
13import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model'
14import { RegisteredServerSettings, RegisterServerSettingOptions } from '@shared/models/plugins/register-server-setting.model'
15import { PluginService } from '@app/core/plugins/plugin.service' 6import { PluginService } from '@app/core/plugins/plugin.service'
16import { Observable } from 'rxjs' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import {
9 InstallOrUpdatePlugin,
10 ManagePlugin,
11 PeerTubePlugin,
12 PeerTubePluginIndex,
13 peertubeTranslate,
14 PluginType,
15 RegisteredServerSettings,
16 ResultList
17} from '@shared/models'
18import { environment } from '../../../../environments/environment'
17 19
18@Injectable() 20@Injectable()
19export class PluginApiService { 21export class PluginApiService {
diff --git a/client/src/app/+admin/system/debug/debug.component.ts b/client/src/app/+admin/system/debug/debug.component.ts
index 8a77f79f7..a88d837f3 100644
--- a/client/src/app/+admin/system/debug/debug.component.ts
+++ b/client/src/app/+admin/system/debug/debug.component.ts
@@ -1,7 +1,7 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier } from '@app/core'
3import { Debug } from '@shared/models/server' 3import { Debug } from '@shared/models'
4import { DebugService } from '@app/+admin/system/debug/debug.service' 4import { DebugService } from './debug.service'
5 5
6@Component({ 6@Component({
7 templateUrl: './debug.component.html', 7 templateUrl: './debug.component.html',
diff --git a/client/src/app/+admin/system/debug/debug.service.ts b/client/src/app/+admin/system/debug/debug.service.ts
index 6c722d177..ab1d0a7fa 100644
--- a/client/src/app/+admin/system/debug/debug.service.ts
+++ b/client/src/app/+admin/system/debug/debug.service.ts
@@ -1,10 +1,10 @@
1import { Observable } from 'rxjs'
1import { catchError } from 'rxjs/operators' 2import { catchError } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 3import { HttpClient } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { Observable } from 'rxjs' 5import { RestExtractor } from '@app/core'
6import { Debug } from '@shared/models'
5import { environment } from '../../../../environments/environment' 7import { environment } from '../../../../environments/environment'
6import { RestExtractor, RestService } from '../../../shared'
7import { Debug } from '@shared/models/server'
8 8
9@Injectable() 9@Injectable()
10export class DebugService { 10export class DebugService {
@@ -12,7 +12,6 @@ export class DebugService {
12 12
13 constructor ( 13 constructor (
14 private authHttp: HttpClient, 14 private authHttp: HttpClient,
15 private restService: RestService,
16 private restExtractor: RestExtractor 15 private restExtractor: RestExtractor
17 ) {} 16 ) {}
18 17
diff --git a/client/src/app/+admin/system/index.ts b/client/src/app/+admin/system/index.ts
index 226d999d2..8cced0cdb 100644
--- a/client/src/app/+admin/system/index.ts
+++ b/client/src/app/+admin/system/index.ts
@@ -1,3 +1,4 @@
1export * from './debug'
1export * from './jobs' 2export * from './jobs'
2export * from './logs' 3export * from './logs'
3export * from './system.component' 4export * from './system.component'
diff --git a/client/src/app/+admin/system/jobs/job.service.ts b/client/src/app/+admin/system/jobs/job.service.ts
index 1e2291ad1..1ac50f050 100644
--- a/client/src/app/+admin/system/jobs/job.service.ts
+++ b/client/src/app/+admin/system/jobs/job.service.ts
@@ -1,12 +1,11 @@
1import { SortMeta } from 'primeng/api'
2import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 3import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
4import { SortMeta } from 'primeng/api' 6import { RestExtractor, RestPagination, RestService } from '@app/core'
5import { Observable } from 'rxjs' 7import { Job, ResultList } from '@shared/models'
6import { ResultList } from '../../../../../../shared'
7import { Job } from '../../../../../../shared/models/server/job.model'
8import { environment } from '../../../../environments/environment' 8import { environment } from '../../../../environments/environment'
9import { RestExtractor, RestPagination, RestService } from '../../../shared'
10import { JobStateClient } from '../../../../types/job-state-client.type' 9import { JobStateClient } from '../../../../types/job-state-client.type'
11import { JobTypeClient } from '../../../../types/job-type-client.type' 10import { JobTypeClient } from '../../../../types/job-type-client.type'
12 11
diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts
index 4f7f7c368..38a78de33 100644
--- a/client/src/app/+admin/system/jobs/jobs.component.ts
+++ b/client/src/app/+admin/system/jobs/jobs.component.ts
@@ -1,14 +1,12 @@
1import { Component, OnInit } from '@angular/core'
2import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage'
3import { Notifier } from '@app/core'
4import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
5import { Job, JobType } from '../../../../../../shared/index' 2import { Component, OnInit } from '@angular/core'
6import { JobState } from '../../../../../../shared/models' 3import { Notifier, RestPagination, RestTable } from '@app/core'
7import { RestPagination, RestTable } from '../../../shared' 4import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage'
8import { JobService } from './job.service'
9import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { Job, JobState, JobType } from '@shared/models'
10import { JobStateClient } from '../../../../types/job-state-client.type' 7import { JobStateClient } from '../../../../types/job-state-client.type'
11import { JobTypeClient } from '../../../../types/job-type-client.type' 8import { JobTypeClient } from '../../../../types/job-type-client.type'
9import { JobService } from './job.service'
12 10
13@Component({ 11@Component({
14 selector: 'my-jobs', 12 selector: 'my-jobs',
diff --git a/client/src/app/+admin/system/logs/log-row.model.ts b/client/src/app/+admin/system/logs/log-row.model.ts
index b22581b5a..615778210 100644
--- a/client/src/app/+admin/system/logs/log-row.model.ts
+++ b/client/src/app/+admin/system/logs/log-row.model.ts
@@ -1,4 +1,4 @@
1import { LogLevel } from '@shared/models/server/log-level.type' 1import { LogLevel } from '@shared/models'
2import omit from 'lodash-es/omit' 2import omit from 'lodash-es/omit'
3 3
4export class LogRow { 4export class LogRow {
diff --git a/client/src/app/+admin/system/logs/logs.component.ts b/client/src/app/+admin/system/logs/logs.component.ts
index b63f11953..51f047188 100644
--- a/client/src/app/+admin/system/logs/logs.component.ts
+++ b/client/src/app/+admin/system/logs/logs.component.ts
@@ -1,9 +1,9 @@
1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
2import { LogsService } from '@app/+admin/system/logs/logs.service'
3import { Notifier } from '@app/core' 2import { Notifier } from '@app/core'
4import { LogRow } from '@app/+admin/system/logs/log-row.model'
5import { I18n } from '@ngx-translate/i18n-polyfill' 3import { I18n } from '@ngx-translate/i18n-polyfill'
6import { LogLevel } from '@shared/models/server/log-level.type' 4import { LogLevel } from '@shared/models'
5import { LogRow } from './log-row.model'
6import { LogsService } from './logs.service'
7 7
8@Component({ 8@Component({
9 templateUrl: './logs.component.html', 9 templateUrl: './logs.component.html',
diff --git a/client/src/app/+admin/system/logs/logs.service.ts b/client/src/app/+admin/system/logs/logs.service.ts
index 41b38c7ba..69439a179 100644
--- a/client/src/app/+admin/system/logs/logs.service.ts
+++ b/client/src/app/+admin/system/logs/logs.service.ts
@@ -1,11 +1,11 @@
1import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 2import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { Observable } from 'rxjs' 5import { RestExtractor } from '@app/core'
6import { LogLevel } from '@shared/models'
5import { environment } from '../../../../environments/environment' 7import { environment } from '../../../../environments/environment'
6import { RestExtractor, RestService } from '../../../shared' 8import { LogRow } from './log-row.model'
7import { LogRow } from '@app/+admin/system/logs/log-row.model'
8import { LogLevel } from '@shared/models/server/log-level.type'
9 9
10@Injectable() 10@Injectable()
11export class LogsService { 11export class LogsService {
@@ -14,7 +14,6 @@ export class LogsService {
14 14
15 constructor ( 15 constructor (
16 private authHttp: HttpClient, 16 private authHttp: HttpClient,
17 private restService: RestService,
18 private restExtractor: RestExtractor 17 private restExtractor: RestExtractor
19 ) {} 18 ) {}
20 19
diff --git a/client/src/app/+admin/system/system.routes.ts b/client/src/app/+admin/system/system.routes.ts
index 2d851794d..0e8d98519 100644
--- a/client/src/app/+admin/system/system.routes.ts
+++ b/client/src/app/+admin/system/system.routes.ts
@@ -1,10 +1,10 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2import { UserRightGuard } from '../../core' 2import { UserRightGuard } from '@app/core'
3import { UserRight } from '../../../../../shared' 3import { UserRight } from '@shared/models'
4import { JobsComponent } from '@app/+admin/system/jobs/jobs.component' 4import { DebugComponent } from './debug'
5import { LogsComponent } from '@app/+admin/system/logs' 5import { JobsComponent } from './jobs/jobs.component'
6import { SystemComponent } from '@app/+admin/system/system.component' 6import { LogsComponent } from './logs'
7import { DebugComponent } from '@app/+admin/system/debug' 7import { SystemComponent } from './system.component'
8 8
9export const SystemRoutes: Routes = [ 9export const SystemRoutes: Routes = [
10 { 10 {
diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts
index b459eb8fa..f9f5b90bd 100644
--- a/client/src/app/+admin/users/user-edit/user-create.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-create.component.ts
@@ -1,14 +1,11 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Router, ActivatedRoute } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, Notifier, ServerService } from '@app/core'
4import { UserCreate, UserRole } from '../../../../../../shared'
5import { UserEdit } from './user-edit'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
8import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
9import { ConfigService } from '@app/+admin/config/shared/config.service' 3import { ConfigService } from '@app/+admin/config/shared/config.service'
10import { UserService } from '@app/shared' 4import { AuthService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
11import { ScreenService } from '@app/shared/misc/screen.service' 5import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { UserCreate, UserRole } from '@shared/models'
8import { UserEdit } from './user-edit'
12 9
13@Component({ 10@Component({
14 selector: 'my-user-create', 11 selector: 'my-user-create',
diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts
index 5f5cc590c..8fa4b0635 100644
--- a/client/src/app/+admin/users/user-edit/user-edit.ts
+++ b/client/src/app/+admin/users/user-edit/user-edit.ts
@@ -1,11 +1,8 @@
1import { AuthService, ServerService } from '../../../core'
2import { FormReactive } from '../../../shared'
3import { ServerConfig, USER_ROLE_LABELS, UserRole, VideoResolution } from '../../../../../../shared'
4import { ConfigService } from '@app/+admin/config/shared/config.service'
5import { UserAdminFlag } from '@shared/models/users/user-flag.model'
6import { OnInit } from '@angular/core' 1import { OnInit } from '@angular/core'
7import { User } from '@app/shared/users/user.model' 2import { ConfigService } from '@app/+admin/config/shared/config.service'
8import { ScreenService } from '@app/shared/misc/screen.service' 3import { AuthService, ScreenService, ServerService, User } from '@app/core'
4import { FormReactive } from '@app/shared/shared-forms'
5import { ServerConfig, USER_ROLE_LABELS, UserAdminFlag, UserRole, VideoResolution } from '@shared/models'
9 6
10export abstract class UserEdit extends FormReactive implements OnInit { 7export abstract class UserEdit extends FormReactive implements OnInit {
11 videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = [] 8 videoQuotaOptions: { value: string, label: string, disabled?: boolean }[] = []
diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/users/user-edit/user-password.component.ts
index ecad000f7..33c7de31f 100644
--- a/client/src/app/+admin/users/user-edit/user-password.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-password.component.ts
@@ -1,12 +1,8 @@
1import { Component, Input, OnInit } from '@angular/core' 1import { Component, Input, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { Notifier, UserService } from '@app/core'
3import { UserService } from '@app/shared/users/user.service' 3import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
4import { Notifier } from '../../../core'
5import { User, UserUpdate } from '../../../../../../shared'
6import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
7import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 5import { UserUpdate } from '@shared/models'
8import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
9import { FormReactive } from '../../../shared'
10 6
11@Component({ 7@Component({
12 selector: 'my-user-password', 8 selector: 'my-user-password',
diff --git a/client/src/app/+admin/users/user-edit/user-update.component.ts b/client/src/app/+admin/users/user-edit/user-update.component.ts
index 035c0d4bb..870880fee 100644
--- a/client/src/app/+admin/users/user-edit/user-update.component.ts
+++ b/client/src/app/+admin/users/user-edit/user-update.component.ts
@@ -1,18 +1,12 @@
1import { Subscription } from 'rxjs'
1import { Component, OnDestroy, OnInit } from '@angular/core' 2import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
3import { Subscription } from 'rxjs'
4import { AuthService, Notifier } from '@app/core'
5import { ServerService } from '../../../core'
6import { UserEdit } from './user-edit'
7import { User as UserType, UserUpdate, UserRole } from '../../../../../../shared'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
10import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
11import { ConfigService } from '@app/+admin/config/shared/config.service' 4import { ConfigService } from '@app/+admin/config/shared/config.service'
12import { UserService } from '@app/shared' 5import { AuthService, Notifier, ScreenService, ServerService, User, UserService } from '@app/core'
13import { UserAdminFlag } from '@shared/models/users/user-flag.model' 6import { FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
14import { User } from '@app/shared/users/user.model' 7import { I18n } from '@ngx-translate/i18n-polyfill'
15import { ScreenService } from '@app/shared/misc/screen.service' 8import { User as UserType, UserAdminFlag, UserRole, UserUpdate } from '@shared/models'
9import { UserEdit } from './user-edit'
16 10
17@Component({ 11@Component({
18 selector: 'my-user-update', 12 selector: 'my-user-update',
diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts
index da50b7ed0..8f01c7d51 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/users/user-list/user-list.component.ts
@@ -1,13 +1,10 @@
1import { Component, OnInit, ViewChild } from '@angular/core'
2import { AuthService, Notifier } from '@app/core'
3import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
4import { ConfirmService, ServerService } from '../../../core' 2import { Component, OnInit, ViewChild } from '@angular/core'
5import { RestPagination, RestTable, UserService } from '../../../shared' 3import { AuthService, ConfirmService, Notifier, RestPagination, RestTable, ServerService, UserService } from '@app/core'
4import { Actor, DropdownAction } from '@app/shared/shared-main'
5import { UserBanModalComponent } from '@app/shared/shared-moderation'
6import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { ServerConfig, User } from '../../../../../../shared' 7import { ServerConfig, User } from '@shared/models'
8import { UserBanModalComponent } from '@app/shared/moderation'
9import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
10import { Actor } from '@app/shared/actor/actor.model'
11 8
12@Component({ 9@Component({
13 selector: 'my-user-list', 10 selector: 'my-user-list',
diff --git a/client/src/app/+admin/users/users.routes.ts b/client/src/app/+admin/users/users.routes.ts
index 2d4f9305e..6560f0260 100644
--- a/client/src/app/+admin/users/users.routes.ts
+++ b/client/src/app/+admin/users/users.routes.ts
@@ -1,11 +1,9 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2 2import { ServerConfigResolver, UserRightGuard } from '@app/core'
3import { UserRightGuard } from '../../core' 3import { UserRight } from '@shared/models'
4import { UserRight } from '../../../../../shared'
5import { UsersComponent } from './users.component'
6import { UserCreateComponent, UserUpdateComponent } from './user-edit' 4import { UserCreateComponent, UserUpdateComponent } from './user-edit'
7import { UserListComponent } from './user-list' 5import { UserListComponent } from './user-list'
8import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service' 6import { UsersComponent } from './users.component'
9 7
10export const UsersRoutes: Routes = [ 8export const UsersRoutes: Routes = [
11 { 9 {
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts
index a68f79b47..039c389e4 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-create.component.ts
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-create.component.ts
@@ -1,12 +1,11 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Router } from '@angular/router' 2import { Router } from '@angular/router'
3import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier } from '@app/core'
4import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' 4import { FormValidatorService, VideoChannelValidatorsService } from '@app/shared/shared-forms'
5import { VideoChannelCreate } from '../../../../../shared/models/videos' 5import { VideoChannelService } from '@app/shared/shared-main'
6import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
7import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
8import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 7import { VideoChannelCreate } from '@shared/models'
9import { VideoChannelValidatorsService } from '@app/shared/forms/form-validators/video-channel-validators.service' 8import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit'
10 9
11@Component({ 10@Component({
12 selector: 'my-account-video-channel-create', 11 selector: 'my-account-video-channel-create',
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.html
index 048d143cd..048d143cd 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.html
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.html
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.scss b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.scss
index 8f8af655c..8f8af655c 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.component.scss
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.component.scss
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.ts
index 355cb4f55..710c51d8e 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-edit.ts
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-edit.ts
@@ -1,5 +1,5 @@
1import { FormReactive } from '@app/shared' 1import { FormReactive } from '@app/shared/shared-forms'
2import { VideoChannel } from '@app/shared/video-channel/video-channel.model' 2import { VideoChannel } from '@app/shared/shared-main'
3 3
4export abstract class MyAccountVideoChannelEdit extends FormReactive { 4export abstract class MyAccountVideoChannelEdit extends FormReactive {
5 // We need it even in the create component because it's used in the edit template 5 // We need it even in the create component because it's used in the edit template
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts
index 9c948b367..489c437ea 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channel-update.component.ts
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channel-update.component.ts
@@ -1,15 +1,12 @@
1import { Subscription } from 'rxjs'
1import { Component, OnDestroy, OnInit } from '@angular/core' 2import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, Notifier, ServerService } from '@app/core' 4import { AuthService, Notifier, ServerService } from '@app/core'
4import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit' 5import { FormValidatorService, VideoChannelValidatorsService } from '@app/shared/shared-forms'
5import { VideoChannelUpdate } from '../../../../../shared/models/videos' 6import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
6import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
7import { Subscription } from 'rxjs'
8import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
9import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
10import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 8import { ServerConfig, VideoChannelUpdate } from '@shared/models'
11import { VideoChannelValidatorsService } from '@app/shared/forms/form-validators/video-channel-validators.service' 9import { MyAccountVideoChannelEdit } from './my-account-video-channel-edit'
12import { ServerConfig } from '@shared/models'
13 10
14@Component({ 11@Component({
15 selector: 'my-account-video-channel-update', 12 selector: 'my-account-video-channel-update',
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels-routing.module.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels-routing.module.ts
index 94037e18f..94037e18f 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels-routing.module.ts
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels-routing.module.ts
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.html
index b2e8210d3..b2e8210d3 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.html
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.html
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.scss b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.scss
index 76fb2cde0..76fb2cde0 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.scss
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.scss
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.ts
index 9caefe5b1..70510d7c9 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.component.ts
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.component.ts
@@ -1,15 +1,10 @@
1import { Component, OnInit } from '@angular/core' 1import { ChartData } from 'chart.js'
2import { Notifier } from '@app/core' 2import { max, maxBy, min, minBy } from 'lodash-es'
3import { AuthService } from '../../core/auth'
4import { ConfirmService } from '../../core/confirm'
5import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
6import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
7import { ScreenService } from '@app/shared/misc/screen.service'
8import { User } from '@app/shared'
9import { flatMap } from 'rxjs/operators' 3import { flatMap } from 'rxjs/operators'
4import { Component, OnInit } from '@angular/core'
5import { AuthService, ConfirmService, Notifier, ScreenService, User } from '@app/core'
6import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
10import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
11import { min, minBy, max, maxBy } from 'lodash-es'
12import { ChartData } from 'chart.js'
13 8
14@Component({ 9@Component({
15 selector: 'my-account-video-channels', 10 selector: 'my-account-video-channels',
diff --git a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.module.ts b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.module.ts
index 87d6b762f..f8c6ad56b 100644
--- a/client/src/app/+my-account/my-account-video-channels/my-account-video-channels.module.ts
+++ b/client/src/app/+my-account/+my-account-video-channels/my-account-video-channels.module.ts
@@ -1,16 +1,22 @@
1import { NgModule } from '@angular/core'
2import { ChartModule } from 'primeng/chart' 1import { ChartModule } from 'primeng/chart'
3import { MyAccountVideoChannelsRoutingModule } from './my-account-video-channels-routing.module' 2import { NgModule } from '@angular/core'
4import { MyAccountVideoChannelsComponent } from './my-account-video-channels.component' 3import { SharedFormModule } from '@app/shared/shared-forms'
4import { SharedGlobalIconModule } from '@app/shared/shared-icons'
5import { SharedMainModule } from '@app/shared/shared-main'
5import { MyAccountVideoChannelCreateComponent } from './my-account-video-channel-create.component' 6import { MyAccountVideoChannelCreateComponent } from './my-account-video-channel-create.component'
6import { MyAccountVideoChannelUpdateComponent } from './my-account-video-channel-update.component' 7import { MyAccountVideoChannelUpdateComponent } from './my-account-video-channel-update.component'
7import { SharedModule } from '@app/shared' 8import { MyAccountVideoChannelsRoutingModule } from './my-account-video-channels-routing.module'
9import { MyAccountVideoChannelsComponent } from './my-account-video-channels.component'
8 10
9@NgModule({ 11@NgModule({
10 imports: [ 12 imports: [
11 MyAccountVideoChannelsRoutingModule, 13 MyAccountVideoChannelsRoutingModule,
12 SharedModule, 14
13 ChartModule 15 ChartModule,
16
17 SharedMainModule,
18 SharedFormModule,
19 SharedGlobalIconModule
14 ], 20 ],
15 21
16 declarations: [ 22 declarations: [
diff --git a/client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.ts b/client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.ts
index e48c39cdf..03ec75e25 100644
--- a/client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.ts
+++ b/client/src/app/+my-account/my-account-blocklist/my-account-blocklist.component.ts
@@ -1,10 +1,10 @@
1import { Component } from '@angular/core' 1import { Component } from '@angular/core'
2import { GenericAccountBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' 2import { BlocklistComponentType, GenericAccountBlocklistComponent } from '@app/shared/shared-moderation'
3 3
4@Component({ 4@Component({
5 selector: 'my-account-blocklist', 5 selector: 'my-account-blocklist',
6 styleUrls: [ '../../shared/blocklist/account-blocklist.component.scss' ], 6 styleUrls: [ '../../shared/shared-moderation/account-blocklist.component.scss' ],
7 templateUrl: '../../shared/blocklist/account-blocklist.component.html' 7 templateUrl: '../../shared/shared-moderation/account-blocklist.component.html'
8}) 8})
9export class MyAccountBlocklistComponent extends GenericAccountBlocklistComponent { 9export class MyAccountBlocklistComponent extends GenericAccountBlocklistComponent {
10 mode = BlocklistComponentType.Account 10 mode = BlocklistComponentType.Account
diff --git a/client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts b/client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts
index cfaba1c7b..9b983a197 100644
--- a/client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts
+++ b/client/src/app/+my-account/my-account-blocklist/my-account-server-blocklist.component.ts
@@ -1,10 +1,10 @@
1import { Component } from '@angular/core' 1import { Component } from '@angular/core'
2import { GenericServerBlocklistComponent, BlocklistComponentType } from '@app/shared/blocklist' 2import { BlocklistComponentType, GenericServerBlocklistComponent } from '@app/shared/shared-moderation'
3 3
4@Component({ 4@Component({
5 selector: 'my-account-server-blocklist', 5 selector: 'my-account-server-blocklist',
6 styleUrls: [ '../../+admin/moderation/moderation.component.scss', '../../shared/blocklist/server-blocklist.component.scss' ], 6 styleUrls: [ '../../+admin/moderation/moderation.component.scss', '../../shared/shared-moderation/server-blocklist.component.scss' ],
7 templateUrl: '../../shared/blocklist/server-blocklist.component.html' 7 templateUrl: '../../shared/shared-moderation/server-blocklist.component.html'
8}) 8})
9export class MyAccountServerBlocklistComponent extends GenericServerBlocklistComponent { 9export class MyAccountServerBlocklistComponent extends GenericServerBlocklistComponent {
10 mode = BlocklistComponentType.Account 10 mode = BlocklistComponentType.Account
diff --git a/client/src/app/+my-account/my-account-history/my-account-history.component.ts b/client/src/app/+my-account/my-account-history/my-account-history.component.ts
index 5f0ccee50..dc78b3d6e 100644
--- a/client/src/app/+my-account/my-account-history/my-account-history.component.ts
+++ b/client/src/app/+my-account/my-account-history/my-account-history.component.ts
@@ -1,17 +1,19 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils' 3import {
4import { ComponentPagination } from '@app/shared/rest/component-pagination.model' 4 AuthService,
5import { AuthService } from '../../core/auth' 5 ComponentPagination,
6import { ConfirmService } from '../../core/confirm' 6 ConfirmService,
7import { AbstractVideoList } from '../../shared/video/abstract-video-list' 7 LocalStorageService,
8import { VideoService } from '../../shared/video/video.service' 8 Notifier,
9 ScreenService,
10 ServerService,
11 UserService
12} from '@app/core'
13import { immutableAssign } from '@app/helpers'
14import { UserHistoryService } from '@app/shared/shared-main'
15import { AbstractVideoList } from '@app/shared/shared-video-miniature'
9import { I18n } from '@ngx-translate/i18n-polyfill' 16import { I18n } from '@ngx-translate/i18n-polyfill'
10import { ScreenService } from '@app/shared/misc/screen.service'
11import { UserHistoryService } from '@app/shared/users/user-history.service'
12import { UserService } from '@app/shared'
13import { Notifier, ServerService } from '@app/core'
14import { LocalStorageService } from '@app/shared/misc/storage.service'
15 17
16@Component({ 18@Component({
17 selector: 'my-account-history', 19 selector: 'my-account-history',
@@ -38,7 +40,6 @@ export class MyAccountHistoryComponent extends AbstractVideoList implements OnIn
38 protected screenService: ScreenService, 40 protected screenService: ScreenService,
39 protected storageService: LocalStorageService, 41 protected storageService: LocalStorageService,
40 private confirmService: ConfirmService, 42 private confirmService: ConfirmService,
41 private videoService: VideoService,
42 private userHistoryService: UserHistoryService 43 private userHistoryService: UserHistoryService
43 ) { 44 ) {
44 super() 45 super()
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts
index a50cb0fb9..0c1427d96 100644
--- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts
+++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts
@@ -1,5 +1,5 @@
1import { Component, ViewChild } from '@angular/core' 1import { Component, ViewChild } from '@angular/core'
2import { UserNotificationsComponent } from '@app/shared' 2import { UserNotificationsComponent } from '@app/shared/shared-main'
3 3
4@Component({ 4@Component({
5 templateUrl: './my-account-notifications.component.html', 5 templateUrl: './my-account-notifications.component.html',
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts
index d5682914e..0e62b5ca5 100644
--- a/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts
+++ b/client/src/app/+my-account/my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component.ts
@@ -1,14 +1,10 @@
1import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
2import { AuthService, Notifier } from '@app/core' 2import { AuthService, Notifier } from '@app/core'
3import { FormReactive } from '@app/shared' 3import { FormReactive, FormValidatorService, VideoAcceptOwnershipValidatorsService } from '@app/shared/shared-forms'
4import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 4import { VideoChannelService, VideoOwnershipService } from '@app/shared/shared-main'
5import { VideoOwnershipService } from '@app/shared/video-ownership'
6import { VideoChangeOwnership } from '../../../../../../shared/models/videos'
7import { VideoAcceptOwnershipValidatorsService } from '@app/shared/forms/form-validators'
8import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
9import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
10import { I18n } from '@ngx-translate/i18n-polyfill'
11import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 5import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { VideoChangeOwnership, VideoChannel } from '@shared/models'
12 8
13@Component({ 9@Component({
14 selector: 'my-account-accept-ownership', 10 selector: 'my-account-accept-ownership',
diff --git a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
index f0a6303d1..5167732c2 100644
--- a/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
+++ b/client/src/app/+my-account/my-account-ownership/my-account-ownership.component.ts
@@ -1,10 +1,8 @@
1import { Component, OnInit, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core'
3import { RestPagination, RestTable } from '@app/shared'
4import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
5import { VideoChangeOwnership } from '../../../../../shared' 2import { Component, OnInit, ViewChild } from '@angular/core'
6import { VideoOwnershipService } from '@app/shared/video-ownership' 3import { Notifier, RestPagination, RestTable } from '@app/core'
7import { Account } from '@app/shared/account/account.model' 4import { Account, VideoOwnershipService } from '@app/shared/shared-main'
5import { VideoChangeOwnership } from '@shared/models'
8import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component' 6import { MyAccountAcceptOwnershipComponent } from './my-account-accept-ownership/my-account-accept-ownership.component'
9 7
10@Component({ 8@Component({
diff --git a/client/src/app/+my-account/my-account-routing.module.ts b/client/src/app/+my-account/my-account-routing.module.ts
index f6b711e09..ac9cf4cfd 100644
--- a/client/src/app/+my-account/my-account-routing.module.ts
+++ b/client/src/app/+my-account/my-account-routing.module.ts
@@ -2,26 +2,20 @@ import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3import { MetaGuard } from '@ngx-meta/core' 3import { MetaGuard } from '@ngx-meta/core'
4import { LoginGuard } from '../core' 4import { LoginGuard } from '../core'
5import { MyAccountComponent } from './my-account.component' 5import { MyAccountBlocklistComponent } from './my-account-blocklist/my-account-blocklist.component'
6import { MyAccountServerBlocklistComponent } from './my-account-blocklist/my-account-server-blocklist.component'
7import { MyAccountHistoryComponent } from './my-account-history/my-account-history.component'
8import { MyAccountNotificationsComponent } from './my-account-notifications/my-account-notifications.component'
9import { MyAccountOwnershipComponent } from './my-account-ownership/my-account-ownership.component'
6import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' 10import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component'
11import { MyAccountSubscriptionsComponent } from './my-account-subscriptions/my-account-subscriptions.component'
12import { MyAccountVideoImportsComponent } from './my-account-video-imports/my-account-video-imports.component'
13import { MyAccountVideoPlaylistCreateComponent } from './my-account-video-playlists/my-account-video-playlist-create.component'
14import { MyAccountVideoPlaylistElementsComponent } from './my-account-video-playlists/my-account-video-playlist-elements.component'
15import { MyAccountVideoPlaylistUpdateComponent } from './my-account-video-playlists/my-account-video-playlist-update.component'
16import { MyAccountVideoPlaylistsComponent } from './my-account-video-playlists/my-account-video-playlists.component'
7import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component' 17import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component'
8import { MyAccountVideoImportsComponent } from '@app/+my-account/my-account-video-imports/my-account-video-imports.component' 18import { MyAccountComponent } from './my-account.component'
9import { MyAccountSubscriptionsComponent } from '@app/+my-account/my-account-subscriptions/my-account-subscriptions.component'
10import { MyAccountOwnershipComponent } from '@app/+my-account/my-account-ownership/my-account-ownership.component'
11import { MyAccountBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-blocklist.component'
12import { MyAccountServerBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-server-blocklist.component'
13import { MyAccountHistoryComponent } from '@app/+my-account/my-account-history/my-account-history.component'
14import { MyAccountNotificationsComponent } from '@app/+my-account/my-account-notifications/my-account-notifications.component'
15import { MyAccountVideoPlaylistsComponent } from '@app/+my-account/my-account-video-playlists/my-account-video-playlists.component'
16import {
17 MyAccountVideoPlaylistCreateComponent
18} from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component'
19import {
20 MyAccountVideoPlaylistUpdateComponent
21} from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component'
22import {
23 MyAccountVideoPlaylistElementsComponent
24} from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component'
25 19
26const myAccountRoutes: Routes = [ 20const myAccountRoutes: Routes = [
27 { 21 {
@@ -46,7 +40,10 @@ const myAccountRoutes: Routes = [
46 40
47 { 41 {
48 path: 'video-channels', 42 path: 'video-channels',
49 loadChildren: () => import('./my-account-video-channels/my-account-video-channels.module').then(m => m.MyAccountVideoChannelsModule) 43 loadChildren: () => {
44 return import('./+my-account-video-channels/my-account-video-channels.module')
45 .then(m => m.MyAccountVideoChannelsModule)
46 }
50 }, 47 },
51 48
52 { 49 {
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts
index 9d406805f..5444b97ae 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-email/my-account-change-email.component.ts
@@ -1,12 +1,10 @@
1import { forkJoin } from 'rxjs'
2import { tap } from 'rxjs/operators'
1import { Component, OnInit } from '@angular/core' 3import { Component, OnInit } from '@angular/core'
2import { AuthService, Notifier, ServerService } from '@app/core' 4import { AuthService, ServerService, UserService } from '@app/core'
3import { FormReactive, UserService } from '../../../shared' 5import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
4import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
5import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 7import { User } from '@shared/models'
6import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
7import { User } from '../../../../../../shared'
8import { tap } from 'rxjs/operators'
9import { forkJoin } from 'rxjs'
10 8
11@Component({ 9@Component({
12 selector: 'my-account-change-email', 10 selector: 'my-account-change-email',
@@ -21,7 +19,6 @@ export class MyAccountChangeEmailComponent extends FormReactive implements OnIni
21 constructor ( 19 constructor (
22 protected formValidatorService: FormValidatorService, 20 protected formValidatorService: FormValidatorService,
23 private userValidatorsService: UserValidatorsService, 21 private userValidatorsService: UserValidatorsService,
24 private notifier: Notifier,
25 private authService: AuthService, 22 private authService: AuthService,
26 private userService: UserService, 23 private userService: UserService,
27 private serverService: ServerService, 24 private serverService: ServerService,
diff --git a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
index cbb068c7c..6a16f8a2c 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-change-password/my-account-change-password.component.ts
@@ -1,11 +1,9 @@
1import { filter } from 'rxjs/operators'
1import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
2import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier, UserService } from '@app/core'
3import { FormReactive, UserService } from '../../../shared' 4import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
4import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
5import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 6import { User } from '@shared/models'
6import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
7import { filter } from 'rxjs/operators'
8import { User } from '../../../../../../shared'
9 7
10@Component({ 8@Component({
11 selector: 'my-account-change-password', 9 selector: 'my-account-change-password',
diff --git a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
index 25d862867..ae6ac5387 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-danger-zone/my-account-danger-zone.component.ts
@@ -1,9 +1,6 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { Notifier } from '@app/core' 2import { AuthService, ConfirmService, Notifier, RedirectService, User, UserService } from '@app/core'
3import { AuthService, ConfirmService, RedirectService } from '../../../core'
4import { UserService } from '../../../shared'
5import { I18n } from '@ngx-translate/i18n-polyfill' 3import { I18n } from '@ngx-translate/i18n-polyfill'
6import { User } from '@app/shared'
7 4
8@Component({ 5@Component({
9 selector: 'my-account-danger-zone', 6 selector: 'my-account-danger-zone',
diff --git a/client/src/app/+my-account/my-account-settings/my-account-interface/index.ts b/client/src/app/+my-account/my-account-settings/my-account-interface/index.ts
deleted file mode 100644
index 62fce79a8..000000000
--- a/client/src/app/+my-account/my-account-settings/my-account-interface/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './my-account-interface-settings.component'
diff --git a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
index af17a0352..cfa514b26 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-notification-preferences/my-account-notification-preferences.component.ts
@@ -1,11 +1,10 @@
1import { debounce } from 'lodash-es'
2import { Subject } from 'rxjs'
1import { Component, Input, OnInit } from '@angular/core' 3import { Component, Input, OnInit } from '@angular/core'
2import { User } from '@app/shared' 4import { Notifier, ServerService, User } from '@app/core'
5import { UserNotificationService } from '@app/shared/shared-main'
3import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
4import { Subject } from 'rxjs' 7import { UserNotificationSetting, UserNotificationSettingValue, UserRight } from '@shared/models'
5import { UserNotificationSetting, UserNotificationSettingValue, UserRight } from '../../../../../../shared'
6import { Notifier, ServerService } from '@app/core'
7import { debounce } from 'lodash-es'
8import { UserNotificationService } from '@app/shared/users/user-notification.service'
9 8
10@Component({ 9@Component({
11 selector: 'my-account-notification-preferences', 10 selector: 'my-account-notification-preferences',
diff --git a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
index fcad5a6c2..b0d8494e7 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-profile/my-account-profile.component.ts
@@ -1,11 +1,8 @@
1import { Subject } from 'rxjs'
1import { Component, Input, OnInit } from '@angular/core' 2import { Component, Input, OnInit } from '@angular/core'
2import { Notifier } from '@app/core' 3import { Notifier, User, UserService } from '@app/core'
3import { FormReactive, UserService } from '../../../shared' 4import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
4import { User } from '@app/shared'
5import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
7import { Subject } from 'rxjs'
8import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
9 6
10@Component({ 7@Component({
11 selector: 'my-account-profile', 8 selector: 'my-account-profile',
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html
index 040b2130f..2826d8d83 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.html
+++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.html
@@ -34,7 +34,7 @@
34 </div> 34 </div>
35 35
36 <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> 36 <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
37 <my-account-video-settings [user]="user" [userInformationLoaded]="userInformationLoaded"></my-account-video-settings> 37 <my-user-video-settings [user]="user" [userInformationLoaded]="userInformationLoaded"></my-user-video-settings>
38 </div> 38 </div>
39</div> 39</div>
40 40
@@ -55,7 +55,7 @@
55 </div> 55 </div>
56 56
57 <div class="form-group form-group-right col-12 col-lg-8 col-xl-9"> 57 <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
58 <my-account-interface-settings [user]="user" [userInformationLoaded]="userInformationLoaded"></my-account-interface-settings> 58 <my-user-interface-settings [user]="user" [userInformationLoaded]="userInformationLoaded"></my-user-interface-settings>
59 </div> 59 </div>
60</div> 60</div>
61 61
diff --git a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
index f73f3aa1e..4800be24b 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
+++ b/client/src/app/+my-account/my-account-settings/my-account-settings.component.ts
@@ -1,11 +1,8 @@
1import { Component, OnInit, AfterViewChecked } from '@angular/core'
2import { Notifier } from '@app/core'
3import { BytesPipe } from 'ngx-pipes' 1import { BytesPipe } from 'ngx-pipes'
4import { AuthService } from '../../core'
5import { User } from '../../shared'
6import { UserService } from '../../shared/users'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { ViewportScroller } from '@angular/common' 2import { ViewportScroller } from '@angular/common'
3import { AfterViewChecked, Component, OnInit } from '@angular/core'
4import { AuthService, Notifier, User, UserService } from '@app/core'
5import { I18n } from '@ngx-translate/i18n-polyfill'
9 6
10@Component({ 7@Component({
11 selector: 'my-account-settings', 8 selector: 'my-account-settings',
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/index.ts b/client/src/app/+my-account/my-account-settings/my-account-video-settings/index.ts
deleted file mode 100644
index 1253bd369..000000000
--- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './my-account-video-settings.component'
diff --git a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts
index b347fc3fe..390293a28 100644
--- a/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts
+++ b/client/src/app/+my-account/my-account-subscriptions/my-account-subscriptions.component.ts
@@ -1,9 +1,8 @@
1import { Component, OnInit } from '@angular/core'
2import { Notifier } from '@app/core'
3import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
4import { UserSubscriptionService } from '@app/shared/user-subscription'
5import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
6import { Subject } from 'rxjs' 1import { Subject } from 'rxjs'
2import { Component, OnInit } from '@angular/core'
3import { ComponentPagination, Notifier } from '@app/core'
4import { VideoChannel } from '@app/shared/shared-main'
5import { UserSubscriptionService } from '@app/shared/shared-user-subscription'
7 6
8@Component({ 7@Component({
9 selector: 'my-account-subscriptions', 8 selector: 'my-account-subscriptions',
diff --git a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.ts b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.ts
index 4452154eb..42ddb0ee2 100644
--- a/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.ts
+++ b/client/src/app/+my-account/my-account-video-imports/my-account-video-imports.component.ts
@@ -1,9 +1,8 @@
1import { Component, OnInit } from '@angular/core'
2import { RestPagination, RestTable } from '@app/shared'
3import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
4import { Notifier } from '@app/core' 2import { Component, OnInit } from '@angular/core'
5import { VideoImport, VideoImportState } from '../../../../../shared/models/videos' 3import { Notifier, RestPagination, RestTable } from '@app/core'
6import { VideoImportService } from '@app/shared/video-import' 4import { VideoImportService } from '@app/shared/shared-main'
5import { VideoImport, VideoImportState } from '@shared/models'
7 6
8@Component({ 7@Component({
9 selector: 'my-account-video-imports', 8 selector: 'my-account-video-imports',
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
index e47e5f980..e72ae2366 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
@@ -1,14 +1,13 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Router } from '@angular/router' 2import { Router } from '@angular/router'
3import { AuthService, Notifier, ServerService } from '@app/core' 3import { AuthService, Notifier, ServerService } from '@app/core'
4import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit' 4import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms'
5import { VideoPlaylistService } from '@app/shared/shared-video-playlist'
5import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
6import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
7import { VideoPlaylistValidatorsService } from '@app/shared'
8import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model' 7import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model'
9import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
10import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model' 8import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model'
11import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils' 9import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit'
10import { populateAsyncUserVideoChannels } from '@app/helpers'
12 11
13@Component({ 12@Component({
14 selector: 'my-account-video-playlist-create', 13 selector: 'my-account-video-playlist-create',
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-edit.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-edit.ts
index e94188786..7ae8de75e 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-edit.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-edit.ts
@@ -1,6 +1,6 @@
1import { FormReactive } from '@app/shared' 1import { FormReactive } from '@app/shared/shared-forms'
2import { VideoPlaylist } from '@shared/models/videos/playlist/video-playlist.model'
3import { VideoConstant, VideoPlaylistPrivacy } from '@shared/models' 2import { VideoConstant, VideoPlaylistPrivacy } from '@shared/models'
3import { VideoPlaylist } from '@shared/models/videos/playlist/video-playlist.model'
4 4
5export abstract class MyAccountVideoPlaylistEdit extends FormReactive { 5export abstract class MyAccountVideoPlaylistEdit extends FormReactive {
6 // Declare it here to avoid errors in create template 6 // Declare it here to avoid errors in create template
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts
index 366640618..0add81c38 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component.ts
@@ -1,16 +1,9 @@
1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { Notifier, ServerService } from '@app/core'
3import { AuthService } from '../../core/auth'
4import { ConfirmService } from '../../core/confirm'
5import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
6import { Subject, Subscription } from 'rxjs' 1import { Subject, Subscription } from 'rxjs'
7import { ActivatedRoute } from '@angular/router'
8import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
9import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
10import { I18n } from '@ngx-translate/i18n-polyfill'
11import { ScreenService } from '@app/shared/misc/screen.service'
12import { CdkDragDrop } from '@angular/cdk/drag-drop' 2import { CdkDragDrop } from '@angular/cdk/drag-drop'
13import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model' 3import { Component, OnDestroy, OnInit } from '@angular/core'
4import { ActivatedRoute } from '@angular/router'
5import { ComponentPagination, Notifier, ScreenService } from '@app/core'
6import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist'
14 7
15@Component({ 8@Component({
16 selector: 'my-account-video-playlist-elements', 9 selector: 'my-account-video-playlist-elements',
@@ -33,12 +26,8 @@ export class MyAccountVideoPlaylistElementsComponent implements OnInit, OnDestro
33 private paramsSub: Subscription 26 private paramsSub: Subscription
34 27
35 constructor ( 28 constructor (
36 private authService: AuthService,
37 private serverService: ServerService,
38 private notifier: Notifier, 29 private notifier: Notifier,
39 private confirmService: ConfirmService,
40 private route: ActivatedRoute, 30 private route: ActivatedRoute,
41 private i18n: I18n,
42 private screenService: ScreenService, 31 private screenService: ScreenService,
43 private videoPlaylistService: VideoPlaylistService 32 private videoPlaylistService: VideoPlaylistService
44 ) {} 33 ) {}
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts
index 2f85cdd96..6787fb757 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component.ts
@@ -1,16 +1,14 @@
1import { forkJoin, Subscription } from 'rxjs'
2import { map, switchMap } from 'rxjs/operators'
1import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
3import { AuthService, Notifier, ServerService } from '@app/core' 5import { AuthService, Notifier, ServerService } from '@app/core'
4import { forkJoin, Subscription } from 'rxjs' 6import { populateAsyncUserVideoChannels } from '@app/helpers'
7import { FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms'
8import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
5import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
6import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 10import { VideoPlaylistUpdate } from '@shared/models'
7import { MyAccountVideoPlaylistEdit } from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-edit' 11import { MyAccountVideoPlaylistEdit } from './my-account-video-playlist-edit'
8import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils'
9import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
10import { VideoPlaylistValidatorsService } from '@app/shared'
11import { VideoPlaylistUpdate } from '@shared/models/videos/playlist/video-playlist-update.model'
12import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
13import { delayWhen, map, switchMap } from 'rxjs/operators'
14 12
15@Component({ 13@Component({
16 selector: 'my-account-video-playlist-update', 14 selector: 'my-account-video-playlist-update',
diff --git a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
index c6728cc30..ea3bcde4f 100644
--- a/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
+++ b/client/src/app/+my-account/my-account-video-playlists/my-account-video-playlists.component.ts
@@ -1,15 +1,10 @@
1import { Subject } from 'rxjs'
2import { debounceTime, flatMap } from 'rxjs/operators'
1import { Component, OnInit } from '@angular/core' 3import { Component, OnInit } from '@angular/core'
2import { Notifier } from '@app/core' 4import { AuthService, ComponentPagination, ConfirmService, Notifier, User } from '@app/core'
3import { AuthService } from '../../core/auth' 5import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
4import { ConfirmService } from '../../core/confirm'
5import { User } from '@app/shared'
6import { flatMap, debounceTime } from 'rxjs/operators'
7import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
8import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
9import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
10import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
11import { VideoPlaylistType } from '@shared/models' 7import { VideoPlaylistType } from '@shared/models'
12import { Subject } from 'rxjs'
13 8
14@Component({ 9@Component({
15 selector: 'my-account-video-playlists', 10 selector: 'my-account-video-playlists',
diff --git a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
index 0ec033eaf..3cfe8fb38 100644
--- a/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
+++ b/client/src/app/+my-account/my-account-videos/my-account-videos.component.ts
@@ -1,21 +1,15 @@
1import { concat, Observable, Subject } from 'rxjs' 1import { concat, Observable, Subject } from 'rxjs'
2import { tap, toArray, debounceTime } from 'rxjs/operators' 2import { debounceTime, tap, toArray } from 'rxjs/operators'
3import { Component, ViewChild, OnInit } from '@angular/core' 3import { Component, OnInit, ViewChild } from '@angular/core'
4import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
5import { immutableAssign } from '@app/shared/misc/utils' 5import { AuthService, ComponentPagination, ConfirmService, Notifier, ScreenService, ServerService } from '@app/core'
6import { ComponentPagination } from '@app/shared/rest/component-pagination.model' 6import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
7import { Notifier, ServerService } from '@app/core' 7import { immutableAssign } from '@app/helpers'
8import { AuthService } from '../../core/auth' 8import { Video, VideoService } from '@app/shared/shared-main'
9import { ConfirmService } from '../../core/confirm' 9import { MiniatureDisplayOptions, OwnerDisplayType, SelectionType, VideosSelectionComponent } from '@app/shared/shared-video-miniature'
10import { Video } from '../../shared/video/video.model'
11import { VideoService } from '../../shared/video/video.service'
12import { I18n } from '@ngx-translate/i18n-polyfill' 10import { I18n } from '@ngx-translate/i18n-polyfill'
13import { ScreenService } from '@app/shared/misc/screen.service' 11import { VideoSortField } from '@shared/models'
14import { VideoChangeOwnershipComponent } from './video-change-ownership/video-change-ownership.component' 12import { VideoChangeOwnershipComponent } from './video-change-ownership/video-change-ownership.component'
15import { MiniatureDisplayOptions, OwnerDisplayType } from '@app/shared/video/video-miniature.component'
16import { SelectionType, VideosSelectionComponent } from '@app/shared/video/videos-selection.component'
17import { VideoSortField } from '@app/shared/video/sort-field.type'
18import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
19 13
20@Component({ 14@Component({
21 selector: 'my-account-videos', 15 selector: 'my-account-videos',
diff --git a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts
index f4e2b5955..18e716a09 100644
--- a/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts
+++ b/client/src/app/+my-account/my-account-videos/video-change-ownership/video-change-ownership.component.ts
@@ -1,11 +1,9 @@
1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier, UserService } from '@app/core'
3import { FormReactive, FormValidatorService, VideoChangeOwnershipValidatorsService } from '@app/shared/shared-forms'
4import { Video, VideoOwnershipService } from '@app/shared/shared-main'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 5import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { FormReactive, UserService } from '../../../shared/index'
5import { Video } from '@app/shared/video/video.model'
6import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { FormValidatorService, VideoChangeOwnershipValidatorsService } from '@app/shared'
8import { VideoOwnershipService } from '@app/shared/video-ownership'
9 7
10@Component({ 8@Component({
11 selector: 'my-video-change-ownership', 9 selector: 'my-video-change-ownership',
diff --git a/client/src/app/+my-account/my-account.component.ts b/client/src/app/+my-account/my-account.component.ts
index ca447c054..ea4da676a 100644
--- a/client/src/app/+my-account/my-account.component.ts
+++ b/client/src/app/+my-account/my-account.component.ts
@@ -1,8 +1,8 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { ServerService } from '@app/core' 2import { ServerService } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill' 3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { TopMenuDropdownParam } from '@app/shared/menu/top-menu-dropdown.component'
5import { ServerConfig } from '@shared/models' 4import { ServerConfig } from '@shared/models'
5import { TopMenuDropdownParam } from './top-menu-dropdown.component'
6 6
7@Component({ 7@Component({
8 selector: 'my-my-account', 8 selector: 'my-my-account',
diff --git a/client/src/app/+my-account/my-account.module.ts b/client/src/app/+my-account/my-account.module.ts
index 72b9fd9f2..9a11a89ea 100644
--- a/client/src/app/+my-account/my-account.module.ts
+++ b/client/src/app/+my-account/my-account.module.ts
@@ -1,47 +1,55 @@
1import { NgModule } from '@angular/core'
2import { TableModule } from 'primeng/table'
3import { AutoCompleteModule } from 'primeng/autocomplete' 1import { AutoCompleteModule } from 'primeng/autocomplete'
4import { InputSwitchModule } from 'primeng/inputswitch' 2import { InputSwitchModule } from 'primeng/inputswitch'
5import { SharedModule } from '../shared' 3import { TableModule } from 'primeng/table'
4import { DragDropModule } from '@angular/cdk/drag-drop'
5import { NgModule } from '@angular/core'
6import { SharedGlobalIconModule } from '@app/shared/shared-icons'
7import { SharedMainModule } from '@app/shared/shared-main'
8import { SharedModerationModule } from '@app/shared/shared-moderation'
9import { SharedUserInterfaceSettingsModule } from '@app/shared/shared-user-settings'
10import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription/shared-user-subscription.module'
11import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
12import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist/shared-video-playlist.module'
13import { MyAccountBlocklistComponent } from './my-account-blocklist/my-account-blocklist.component'
14import { MyAccountServerBlocklistComponent } from './my-account-blocklist/my-account-server-blocklist.component'
15import { MyAccountHistoryComponent } from './my-account-history/my-account-history.component'
16import { MyAccountNotificationsComponent } from './my-account-notifications/my-account-notifications.component'
17import { MyAccountAcceptOwnershipComponent } from './my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component'
18import { MyAccountOwnershipComponent } from './my-account-ownership/my-account-ownership.component'
6import { MyAccountRoutingModule } from './my-account-routing.module' 19import { MyAccountRoutingModule } from './my-account-routing.module'
20import { MyAccountChangeEmailComponent } from './my-account-settings/my-account-change-email'
7import { MyAccountChangePasswordComponent } from './my-account-settings/my-account-change-password/my-account-change-password.component' 21import { MyAccountChangePasswordComponent } from './my-account-settings/my-account-change-password/my-account-change-password.component'
22import { MyAccountDangerZoneComponent } from './my-account-settings/my-account-danger-zone'
23import { MyAccountNotificationPreferencesComponent } from './my-account-settings/my-account-notification-preferences'
24import { MyAccountProfileComponent } from './my-account-settings/my-account-profile/my-account-profile.component'
8import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component' 25import { MyAccountSettingsComponent } from './my-account-settings/my-account-settings.component'
9import { MyAccountComponent } from './my-account.component' 26import { MyAccountSubscriptionsComponent } from './my-account-subscriptions/my-account-subscriptions.component'
27import { MyAccountVideoImportsComponent } from './my-account-video-imports/my-account-video-imports.component'
28import { MyAccountVideoPlaylistCreateComponent } from './my-account-video-playlists/my-account-video-playlist-create.component'
29import { MyAccountVideoPlaylistElementsComponent } from './my-account-video-playlists/my-account-video-playlist-elements.component'
30import { MyAccountVideoPlaylistUpdateComponent } from './my-account-video-playlists/my-account-video-playlist-update.component'
31import { MyAccountVideoPlaylistsComponent } from './my-account-video-playlists/my-account-video-playlists.component'
10import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component' 32import { MyAccountVideosComponent } from './my-account-videos/my-account-videos.component'
11import { VideoChangeOwnershipComponent } from './my-account-videos/video-change-ownership/video-change-ownership.component' 33import { VideoChangeOwnershipComponent } from './my-account-videos/video-change-ownership/video-change-ownership.component'
12import { MyAccountOwnershipComponent } from './my-account-ownership/my-account-ownership.component' 34import { MyAccountComponent } from './my-account.component'
13import { MyAccountAcceptOwnershipComponent } from './my-account-ownership/my-account-accept-ownership/my-account-accept-ownership.component' 35import { TopMenuDropdownComponent } from './top-menu-dropdown.component'
14import { MyAccountProfileComponent } from '@app/+my-account/my-account-settings/my-account-profile/my-account-profile.component'
15import { MyAccountVideoImportsComponent } from '@app/+my-account/my-account-video-imports/my-account-video-imports.component'
16import { MyAccountDangerZoneComponent } from '@app/+my-account/my-account-settings/my-account-danger-zone'
17import { MyAccountSubscriptionsComponent } from '@app/+my-account/my-account-subscriptions/my-account-subscriptions.component'
18import { MyAccountBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-blocklist.component'
19import { MyAccountServerBlocklistComponent } from '@app/+my-account/my-account-blocklist/my-account-server-blocklist.component'
20import { MyAccountHistoryComponent } from '@app/+my-account/my-account-history/my-account-history.component'
21import { MyAccountNotificationsComponent } from '@app/+my-account/my-account-notifications/my-account-notifications.component'
22import { MyAccountNotificationPreferencesComponent } from '@app/+my-account/my-account-settings/my-account-notification-preferences'
23import {
24 MyAccountVideoPlaylistCreateComponent
25} from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component'
26import {
27 MyAccountVideoPlaylistUpdateComponent
28} from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-update.component'
29import { MyAccountVideoPlaylistsComponent } from '@app/+my-account/my-account-video-playlists/my-account-video-playlists.component'
30import {
31 MyAccountVideoPlaylistElementsComponent
32} from '@app/+my-account/my-account-video-playlists/my-account-video-playlist-elements.component'
33import { DragDropModule } from '@angular/cdk/drag-drop'
34import { MyAccountChangeEmailComponent } from '@app/+my-account/my-account-settings/my-account-change-email'
35 36
36@NgModule({ 37@NgModule({
37 imports: [ 38 imports: [
38 TableModule,
39 MyAccountRoutingModule, 39 MyAccountRoutingModule,
40
40 AutoCompleteModule, 41 AutoCompleteModule,
41 SharedModule,
42 TableModule, 42 TableModule,
43 InputSwitchModule, 43 InputSwitchModule,
44 DragDropModule 44 DragDropModule,
45
46 SharedMainModule,
47 SharedModerationModule,
48 SharedVideoMiniatureModule,
49 SharedUserSubscriptionModule,
50 SharedVideoPlaylistModule,
51 SharedUserInterfaceSettingsModule,
52 SharedGlobalIconModule
45 ], 53 ],
46 54
47 declarations: [ 55 declarations: [
@@ -68,7 +76,9 @@ import { MyAccountChangeEmailComponent } from '@app/+my-account/my-account-setti
68 MyAccountVideoPlaylistCreateComponent, 76 MyAccountVideoPlaylistCreateComponent,
69 MyAccountVideoPlaylistUpdateComponent, 77 MyAccountVideoPlaylistUpdateComponent,
70 MyAccountVideoPlaylistsComponent, 78 MyAccountVideoPlaylistsComponent,
71 MyAccountVideoPlaylistElementsComponent 79 MyAccountVideoPlaylistElementsComponent,
80
81 TopMenuDropdownComponent
72 ], 82 ],
73 83
74 exports: [ 84 exports: [
diff --git a/client/src/app/shared/menu/top-menu-dropdown.component.html b/client/src/app/+my-account/top-menu-dropdown.component.html
index aeaceb662..aeaceb662 100644
--- a/client/src/app/shared/menu/top-menu-dropdown.component.html
+++ b/client/src/app/+my-account/top-menu-dropdown.component.html
diff --git a/client/src/app/shared/menu/top-menu-dropdown.component.scss b/client/src/app/+my-account/top-menu-dropdown.component.scss
index 84dd7dce3..84dd7dce3 100644
--- a/client/src/app/shared/menu/top-menu-dropdown.component.scss
+++ b/client/src/app/+my-account/top-menu-dropdown.component.scss
diff --git a/client/src/app/shared/menu/top-menu-dropdown.component.ts b/client/src/app/+my-account/top-menu-dropdown.component.ts
index 3f121e785..5909db0b5 100644
--- a/client/src/app/shared/menu/top-menu-dropdown.component.ts
+++ b/client/src/app/+my-account/top-menu-dropdown.component.ts
@@ -1,17 +1,10 @@
1import { 1import { Subscription } from 'rxjs'
2 Component,
3 Input,
4 OnDestroy,
5 OnInit,
6 ViewChild
7} from '@angular/core'
8import { filter, take } from 'rxjs/operators' 2import { filter, take } from 'rxjs/operators'
3import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
9import { NavigationEnd, Router } from '@angular/router' 4import { NavigationEnd, Router } from '@angular/router'
10import { Subscription } from 'rxjs' 5import { MenuService, ScreenService } from '@app/core'
6import { GlobalIconName } from '@app/shared/shared-icons'
11import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' 7import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap'
12import { GlobalIconName } from '@app/shared/images/global-icon.component'
13import { ScreenService } from '@app/shared/misc/screen.service'
14import { MenuService } from '@app/core/menu'
15 8
16export type TopMenuDropdownParam = { 9export type TopMenuDropdownParam = {
17 label: string 10 label: string
diff --git a/client/src/app/+page-not-found/page-not-found.module.ts b/client/src/app/+page-not-found/page-not-found.module.ts
index ffc1f777d..2e09ab299 100644
--- a/client/src/app/+page-not-found/page-not-found.module.ts
+++ b/client/src/app/+page-not-found/page-not-found.module.ts
@@ -1,12 +1,13 @@
1import { CommonModule } from '@angular/common'
1import { NgModule } from '@angular/core' 2import { NgModule } from '@angular/core'
2import { SharedModule } from '../shared' 3import { PageNotFoundRoutingModule } from './page-not-found-routing.module'
3import { PageNotFoundComponent } from '@app/+page-not-found/page-not-found.component' 4import { PageNotFoundComponent } from './page-not-found.component'
4import { PageNotFoundRoutingModule } from '@app/+page-not-found/page-not-found-routing.module'
5 5
6@NgModule({ 6@NgModule({
7 imports: [ 7 imports: [
8 PageNotFoundRoutingModule, 8 CommonModule,
9 SharedModule 9
10 PageNotFoundRoutingModule
10 ], 11 ],
11 12
12 declarations: [ 13 declarations: [
diff --git a/client/src/app/+signup/+register/register-routing.module.ts b/client/src/app/+signup/+register/register-routing.module.ts
index f47e80755..0deed8a9b 100644
--- a/client/src/app/+signup/+register/register-routing.module.ts
+++ b/client/src/app/+signup/+register/register-routing.module.ts
@@ -1,9 +1,8 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3import { ServerConfigResolver, UnloggedGuard } from '@app/core'
3import { MetaGuard } from '@ngx-meta/core' 4import { MetaGuard } from '@ngx-meta/core'
4import { RegisterComponent } from './register.component' 5import { RegisterComponent } from './register.component'
5import { ServerConfigResolver } from '@app/core/routing/server-config-resolver.service'
6import { UnloggedGuard } from '@app/core/routing/unlogged-guard.service'
7 6
8const registerRoutes: Routes = [ 7const registerRoutes: Routes = [
9 { 8 {
diff --git a/client/src/app/+signup/+register/register-step-channel.component.ts b/client/src/app/+signup/+register/register-step-channel.component.ts
index e434b91a7..8a0120840 100644
--- a/client/src/app/+signup/+register/register-step-channel.component.ts
+++ b/client/src/app/+signup/+register/register-step-channel.component.ts
@@ -1,10 +1,9 @@
1import { concat, of } from 'rxjs'
2import { pairwise } from 'rxjs/operators'
1import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 3import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
2import { AuthService } from '@app/core'
3import { FormReactive, UserService, VideoChannelValidatorsService } from '@app/shared'
4import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
5import { FormGroup } from '@angular/forms' 4import { FormGroup } from '@angular/forms'
6import { pairwise } from 'rxjs/operators' 5import { UserService } from '@app/core'
7import { concat, of } from 'rxjs' 6import { FormReactive, FormValidatorService, VideoChannelValidatorsService } from '@app/shared/shared-forms'
8 7
9@Component({ 8@Component({
10 selector: 'my-register-step-channel', 9 selector: 'my-register-step-channel',
@@ -17,7 +16,6 @@ export class RegisterStepChannelComponent extends FormReactive implements OnInit
17 16
18 constructor ( 17 constructor (
19 protected formValidatorService: FormValidatorService, 18 protected formValidatorService: FormValidatorService,
20 private authService: AuthService,
21 private userService: UserService, 19 private userService: UserService,
22 private videoChannelValidatorsService: VideoChannelValidatorsService 20 private videoChannelValidatorsService: VideoChannelValidatorsService
23 ) { 21 ) {
diff --git a/client/src/app/+signup/+register/register-step-user.component.ts b/client/src/app/+signup/+register/register-step-user.component.ts
index 6c96f20b4..3d9ab8b6b 100644
--- a/client/src/app/+signup/+register/register-step-user.component.ts
+++ b/client/src/app/+signup/+register/register-step-user.component.ts
@@ -1,10 +1,9 @@
1import { concat, of } from 'rxjs'
2import { pairwise } from 'rxjs/operators'
1import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 3import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
2import { AuthService } from '@app/core'
3import { FormReactive, UserService, UserValidatorsService } from '@app/shared'
4import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
5import { FormGroup } from '@angular/forms' 4import { FormGroup } from '@angular/forms'
6import { pairwise } from 'rxjs/operators' 5import { UserService } from '@app/core'
7import { concat, of } from 'rxjs' 6import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
8 7
9@Component({ 8@Component({
10 selector: 'my-register-step-user', 9 selector: 'my-register-step-user',
@@ -20,7 +19,6 @@ export class RegisterStepUserComponent extends FormReactive implements OnInit {
20 19
21 constructor ( 20 constructor (
22 protected formValidatorService: FormValidatorService, 21 protected formValidatorService: FormValidatorService,
23 private authService: AuthService,
24 private userService: UserService, 22 private userService: UserService,
25 private userValidatorsService: UserValidatorsService 23 private userValidatorsService: UserValidatorsService
26 ) { 24 ) {
diff --git a/client/src/app/+signup/+register/register.component.ts b/client/src/app/+signup/+register/register.component.ts
index ae944ec15..3e8171b27 100644
--- a/client/src/app/+signup/+register/register.component.ts
+++ b/client/src/app/+signup/+register/register.component.ts
@@ -1,14 +1,13 @@
1import { Component, OnInit, ViewChild } from '@angular/core' 1import { Component, OnInit, ViewChild } from '@angular/core'
2import { AuthService, Notifier, RedirectService, ServerService } from '@app/core'
3import { UserService, UserValidatorsService } from '@app/shared'
4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { UserRegister } from '@shared/models/users/user-register.model'
6import { FormGroup } from '@angular/forms' 2import { FormGroup } from '@angular/forms'
7import { About, ServerConfig } from '@shared/models/server' 3import { ActivatedRoute } from '@angular/router'
8import { InstanceService } from '@app/shared/instance/instance.service' 4import { AuthService, Notifier, UserService } from '@app/core'
9import { HooksService } from '@app/core/plugins/hooks.service' 5import { HooksService } from '@app/core/plugins/hooks.service'
6import { InstanceService } from '@app/shared/shared-instance'
10import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap' 7import { NgbAccordion } from '@ng-bootstrap/ng-bootstrap'
11import { ActivatedRoute } from '@angular/router' 8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { UserRegister } from '@shared/models'
10import { About, ServerConfig } from '@shared/models/server'
12 11
13@Component({ 12@Component({
14 selector: 'my-register', 13 selector: 'my-register',
@@ -40,11 +39,8 @@ export class RegisterComponent implements OnInit {
40 constructor ( 39 constructor (
41 private route: ActivatedRoute, 40 private route: ActivatedRoute,
42 private authService: AuthService, 41 private authService: AuthService,
43 private userValidatorsService: UserValidatorsService,
44 private notifier: Notifier, 42 private notifier: Notifier,
45 private userService: UserService, 43 private userService: UserService,
46 private serverService: ServerService,
47 private redirectService: RedirectService,
48 private instanceService: InstanceService, 44 private instanceService: InstanceService,
49 private hooks: HooksService, 45 private hooks: HooksService,
50 private i18n: I18n 46 private i18n: I18n
diff --git a/client/src/app/+signup/+register/register.module.ts b/client/src/app/+signup/+register/register.module.ts
index e55f83990..608045f58 100644
--- a/client/src/app/+signup/+register/register.module.ts
+++ b/client/src/app/+signup/+register/register.module.ts
@@ -1,21 +1,24 @@
1import { CdkStepperModule } from '@angular/cdk/stepper'
1import { NgModule } from '@angular/core' 2import { NgModule } from '@angular/core'
3import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module'
4import { SharedInstanceModule } from '@app/shared/shared-instance'
5import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'
6import { CustomStepperComponent } from './custom-stepper.component'
2import { RegisterRoutingModule } from './register-routing.module' 7import { RegisterRoutingModule } from './register-routing.module'
3import { RegisterComponent } from './register.component'
4import { SharedModule } from '@app/shared'
5import { CdkStepperModule } from '@angular/cdk/stepper'
6import { RegisterStepChannelComponent } from './register-step-channel.component' 8import { RegisterStepChannelComponent } from './register-step-channel.component'
7import { RegisterStepUserComponent } from './register-step-user.component' 9import { RegisterStepUserComponent } from './register-step-user.component'
8import { CustomStepperComponent } from './custom-stepper.component' 10import { RegisterComponent } from './register.component'
9import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module'
10import { NgbAccordionModule } from '@ng-bootstrap/ng-bootstrap'
11 11
12@NgModule({ 12@NgModule({
13 imports: [ 13 imports: [
14 RegisterRoutingModule, 14 RegisterRoutingModule,
15 SharedModule, 15
16 CdkStepperModule, 16 CdkStepperModule,
17 NgbAccordionModule,
18
17 SignupSharedModule, 19 SignupSharedModule,
18 NgbAccordionModule 20
21 SharedInstanceModule
19 ], 22 ],
20 23
21 declarations: [ 24 declarations: [
diff --git a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts
index 3bd604b66..51910471b 100644
--- a/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts
+++ b/client/src/app/+signup/+verify-account/verify-account-ask-send-email/verify-account-ask-send-email.component.ts
@@ -1,10 +1,7 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { Notifier, RedirectService, ServerService, UserService } from '@app/core'
3import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
2import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
3import { Notifier, RedirectService } from '@app/core'
4import { ServerService } from '@app/core/server'
5import { FormReactive, UserService } from '@app/shared'
6import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
7import { UserValidatorsService } from '@app/shared/forms/form-validators/user-validators.service'
8import { ServerConfig } from '@shared/models' 5import { ServerConfig } from '@shared/models'
9 6
10@Component({ 7@Component({
diff --git a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts
index 48ddd7130..586f4e231 100644
--- a/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts
+++ b/client/src/app/+signup/+verify-account/verify-account-email/verify-account-email.component.ts
@@ -1,8 +1,7 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute } from '@angular/router'
3import { AuthService, Notifier, UserService } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
4import { AuthService, Notifier } from '@app/core'
5import { UserService } from '@app/shared'
6 5
7@Component({ 6@Component({
8 selector: 'my-verify-account-email', 7 selector: 'my-verify-account-email',
@@ -21,7 +20,6 @@ export class VerifyAccountEmailComponent implements OnInit {
21 private userService: UserService, 20 private userService: UserService,
22 private authService: AuthService, 21 private authService: AuthService,
23 private notifier: Notifier, 22 private notifier: Notifier,
24 private router: Router,
25 private route: ActivatedRoute, 23 private route: ActivatedRoute,
26 private i18n: I18n 24 private i18n: I18n
27 ) { 25 ) {
diff --git a/client/src/app/+signup/+verify-account/verify-account.module.ts b/client/src/app/+signup/+verify-account/verify-account.module.ts
index 9fe14e81e..7255605d4 100644
--- a/client/src/app/+signup/+verify-account/verify-account.module.ts
+++ b/client/src/app/+signup/+verify-account/verify-account.module.ts
@@ -1,14 +1,13 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { VerifyAccountRoutingModule } from './verify-account-routing.module' 2import { SignupSharedModule } from '../shared/signup-shared.module'
3import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component'
4import { VerifyAccountAskSendEmailComponent } from './verify-account-ask-send-email/verify-account-ask-send-email.component' 3import { VerifyAccountAskSendEmailComponent } from './verify-account-ask-send-email/verify-account-ask-send-email.component'
5import { SharedModule } from '@app/shared' 4import { VerifyAccountEmailComponent } from './verify-account-email/verify-account-email.component'
6import { SignupSharedModule } from '@app/+signup/shared/signup-shared.module' 5import { VerifyAccountRoutingModule } from './verify-account-routing.module'
7 6
8@NgModule({ 7@NgModule({
9 imports: [ 8 imports: [
10 VerifyAccountRoutingModule, 9 VerifyAccountRoutingModule,
11 SharedModule, 10
12 SignupSharedModule 11 SignupSharedModule
13 ], 12 ],
14 13
diff --git a/client/src/app/+signup/shared/signup-shared.module.ts b/client/src/app/+signup/shared/signup-shared.module.ts
index cd21fdef3..56b0b3bae 100644
--- a/client/src/app/+signup/shared/signup-shared.module.ts
+++ b/client/src/app/+signup/shared/signup-shared.module.ts
@@ -1,10 +1,14 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { SignupSuccessComponent } from '../shared/signup-success.component' 2import { SharedMainModule } from '@app/shared/shared-main'
3import { SharedModule } from '@app/shared' 3import { SignupSuccessComponent } from './signup-success.component'
4import { SharedFormModule } from '@app/shared/shared-forms'
5import { SharedGlobalIconModule } from '@app/shared/shared-icons'
4 6
5@NgModule({ 7@NgModule({
6 imports: [ 8 imports: [
7 SharedModule 9 SharedMainModule,
10 SharedFormModule,
11 SharedGlobalIconModule
8 ], 12 ],
9 13
10 declarations: [ 14 declarations: [
@@ -12,6 +16,10 @@ import { SharedModule } from '@app/shared'
12 ], 16 ],
13 17
14 exports: [ 18 exports: [
19 SharedMainModule,
20 SharedFormModule,
21 SharedGlobalIconModule,
22
15 SignupSuccessComponent 23 SignupSuccessComponent
16 ], 24 ],
17 25
diff --git a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts
index 11f9391e1..19e4bc1f4 100644
--- a/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts
+++ b/client/src/app/+video-channels/video-channel-about/video-channel-about.component.ts
@@ -1,9 +1,8 @@
1import { Subscription } from 'rxjs'
1import { Component, OnDestroy, OnInit } from '@angular/core' 2import { Component, OnDestroy, OnInit } from '@angular/core'
2import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 3import { MarkdownService } from '@app/core'
3import { VideoChannel } from '@app/shared/video-channel/video-channel.model' 4import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
4import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
5import { Subscription } from 'rxjs'
6import { MarkdownService } from '@app/shared/renderer'
7 6
8@Component({ 7@Component({
9 selector: 'my-video-channel-about', 8 selector: 'my-video-channel-about',
diff --git a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts
index 0b0033082..8b507c626 100644
--- a/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts
+++ b/client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.ts
@@ -1,12 +1,8 @@
1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ConfirmService } from '../../core/confirm'
3import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
4import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
5import { Subject, Subscription } from 'rxjs' 1import { Subject, Subscription } from 'rxjs'
6import { Notifier } from '@app/core' 2import { Component, OnDestroy, OnInit } from '@angular/core'
7import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' 3import { ComponentPagination, hasMoreItems } from '@app/core'
8import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model' 4import { VideoChannel, VideoChannelService } from '@app/shared/shared-main'
9import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' 5import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
10 6
11@Component({ 7@Component({
12 selector: 'my-video-channel-playlists', 8 selector: 'my-video-channel-playlists',
@@ -28,8 +24,6 @@ export class VideoChannelPlaylistsComponent implements OnInit, OnDestroy {
28 private videoChannel: VideoChannel 24 private videoChannel: VideoChannel
29 25
30 constructor ( 26 constructor (
31 private notifier: Notifier,
32 private confirmService: ConfirmService,
33 private videoPlaylistService: VideoPlaylistService, 27 private videoPlaylistService: VideoPlaylistService,
34 private videoChannelService: VideoChannelService 28 private videoChannelService: VideoChannelService
35 ) {} 29 ) {}
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
index 5749701e8..267c328f2 100644
--- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
+++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts
@@ -1,25 +1,18 @@
1import { Subscription } from 'rxjs'
2import { first, tap } from 'rxjs/operators'
1import { Component, OnDestroy, OnInit } from '@angular/core' 3import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils' 5import { AuthService, ConfirmService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
4import { AuthService } from '../../core/auth' 6import { immutableAssign } from '@app/helpers'
5import { ConfirmService } from '../../core/confirm' 7import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
6import { AbstractVideoList } from '../../shared/video/abstract-video-list' 8import { AbstractVideoList } from '@app/shared/shared-video-miniature'
7import { VideoService } from '../../shared/video/video.service'
8import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
9import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
10import { first, tap } from 'rxjs/operators'
11import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
12import { Subscription } from 'rxjs'
13import { ScreenService } from '@app/shared/misc/screen.service'
14import { Notifier, ServerService } from '@app/core'
15import { UserService } from '@app/shared'
16import { LocalStorageService } from '@app/shared/misc/storage.service'
17 10
18@Component({ 11@Component({
19 selector: 'my-video-channel-videos', 12 selector: 'my-video-channel-videos',
20 templateUrl: '../../shared/video/abstract-video-list.html', 13 templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html',
21 styleUrls: [ 14 styleUrls: [
22 '../../shared/video/abstract-video-list.scss', 15 '../../shared/shared-video-miniature/abstract-video-list.scss',
23 './video-channel-videos.component.scss' 16 './video-channel-videos.component.scss'
24 ] 17 ]
25}) 18})
diff --git a/client/src/app/+video-channels/video-channels-routing.module.ts b/client/src/app/+video-channels/video-channels-routing.module.ts
index d4872a0a5..e79e6a680 100644
--- a/client/src/app/+video-channels/video-channels-routing.module.ts
+++ b/client/src/app/+video-channels/video-channels-routing.module.ts
@@ -1,10 +1,10 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3import { MetaGuard } from '@ngx-meta/core' 3import { MetaGuard } from '@ngx-meta/core'
4import { VideoChannelsComponent } from './video-channels.component'
5import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component'
6import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component' 4import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component'
7import { VideoChannelPlaylistsComponent } from '@app/+video-channels/video-channel-playlists/video-channel-playlists.component' 5import { VideoChannelPlaylistsComponent } from './video-channel-playlists/video-channel-playlists.component'
6import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component'
7import { VideoChannelsComponent } from './video-channels.component'
8 8
9const videoChannelsRoutes: Routes = [ 9const videoChannelsRoutes: Routes = [
10 { 10 {
diff --git a/client/src/app/+video-channels/video-channels.component.ts b/client/src/app/+video-channels/video-channels.component.ts
index a3563c747..cae442ee7 100644
--- a/client/src/app/+video-channels/video-channels.component.ts
+++ b/client/src/app/+video-channels/video-channels.component.ts
@@ -1,16 +1,12 @@
1import { Hotkey, HotkeysService } from 'angular2-hotkeys'
2import { Subscription } from 'rxjs'
3import { catchError, distinctUntilChanged, map, switchMap } from 'rxjs/operators'
1import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core' 4import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'
2import { ActivatedRoute } from '@angular/router' 5import { ActivatedRoute } from '@angular/router'
3import { VideoChannel } from '@app/shared/video-channel/video-channel.model' 6import { AuthService, Notifier, RestExtractor, ScreenService } from '@app/core'
4import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 7import { ListOverflowItem, VideoChannel, VideoChannelService } from '@app/shared/shared-main'
5import { RestExtractor } from '@app/shared' 8import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
6import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators'
7import { Subscription } from 'rxjs'
8import { AuthService, Notifier } from '@app/core'
9import { Hotkey, HotkeysService } from 'angular2-hotkeys'
10import { SubscribeButtonComponent } from '@app/shared/user-subscription/subscribe-button.component'
11import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
12import { ListOverflowItem } from '@app/shared/misc/list-overflow.component'
13import { ScreenService } from '@app/shared/misc/screen.service'
14 10
15@Component({ 11@Component({
16 templateUrl: './video-channels.component.html', 12 templateUrl: './video-channels.component.html',
diff --git a/client/src/app/+video-channels/video-channels.module.ts b/client/src/app/+video-channels/video-channels.module.ts
index 6975d05b2..05236ff85 100644
--- a/client/src/app/+video-channels/video-channels.module.ts
+++ b/client/src/app/+video-channels/video-channels.module.ts
@@ -1,15 +1,26 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { SharedModule } from '../shared' 2import { SharedFormModule } from '@app/shared/shared-forms'
3import { SharedGlobalIconModule } from '@app/shared/shared-icons'
4import { SharedMainModule } from '@app/shared/shared-main'
5import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription'
6import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
7import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist'
8import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component'
9import { VideoChannelPlaylistsComponent } from './video-channel-playlists/video-channel-playlists.component'
10import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component'
3import { VideoChannelsRoutingModule } from './video-channels-routing.module' 11import { VideoChannelsRoutingModule } from './video-channels-routing.module'
4import { VideoChannelsComponent } from './video-channels.component' 12import { VideoChannelsComponent } from './video-channels.component'
5import { VideoChannelVideosComponent } from './video-channel-videos/video-channel-videos.component'
6import { VideoChannelAboutComponent } from './video-channel-about/video-channel-about.component'
7import { VideoChannelPlaylistsComponent } from '@app/+video-channels/video-channel-playlists/video-channel-playlists.component'
8 13
9@NgModule({ 14@NgModule({
10 imports: [ 15 imports: [
11 VideoChannelsRoutingModule, 16 VideoChannelsRoutingModule,
12 SharedModule 17
18 SharedMainModule,
19 SharedFormModule,
20 SharedVideoPlaylistModule,
21 SharedVideoMiniatureModule,
22 SharedUserSubscriptionModule,
23 SharedGlobalIconModule
13 ], 24 ],
14 25
15 declarations: [ 26 declarations: [
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts
index a87f4ce1b..ceda41415 100644
--- a/client/src/app/app-routing.module.ts
+++ b/client/src/app/app-routing.module.ts
@@ -1,10 +1,9 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router' 2import { RouteReuseStrategy, RouterModule, Routes } from '@angular/router'
3
4import { PreloadSelectedModulesList } from './core'
5import { AppComponent } from '@app/app.component' 3import { AppComponent } from '@app/app.component'
6import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy' 4import { CustomReuseStrategy } from '@app/core/routing/custom-reuse-strategy'
7import { MenuGuards } from '@app/core/routing/menu-guard.service' 5import { MenuGuards } from '@app/core/routing/menu-guard.service'
6import { PreloadSelectedModulesList } from './core'
8 7
9const routes: Routes = [ 8const routes: Routes = [
10 { 9 {
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index c77dc97de..a62aa4870 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -1,28 +1,22 @@
1import { Component, OnInit, ViewChild, AfterViewInit, Inject, LOCALE_ID } from '@angular/core' 1import { Hotkey, HotkeysService } from 'angular2-hotkeys'
2import { concat } from 'rxjs'
3import { filter, first, map, pairwise } from 'rxjs/operators'
4import { DOCUMENT, PlatformLocation, ViewportScroller } from '@angular/common'
5import { AfterViewInit, Component, Inject, LOCALE_ID, OnInit, ViewChild } from '@angular/core'
2import { DomSanitizer, SafeHtml } from '@angular/platform-browser' 6import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
3import { Event, GuardsCheckStart, NavigationEnd, Router, Scroll } from '@angular/router' 7import { Event, GuardsCheckStart, NavigationEnd, Router, Scroll } from '@angular/router'
4import { AuthService, RedirectService, ServerService, ThemeService } from '@app/core' 8import { AuthService, MarkdownService, RedirectService, ScreenService, ServerService, ThemeService, User } from '@app/core'
5import { is18nPath, getShortLocale } from '../../../shared/models/i18n'
6import { ScreenService } from '@app/shared/misc/screen.service'
7import { filter, map, pairwise, first } from 'rxjs/operators'
8import { Hotkey, HotkeysService } from 'angular2-hotkeys'
9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { PlatformLocation, ViewportScroller, DOCUMENT } from '@angular/common'
11import { PluginService } from '@app/core/plugins/plugin.service'
12import { HooksService } from '@app/core/plugins/hooks.service' 9import { HooksService } from '@app/core/plugins/hooks.service'
13import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 10import { PluginService } from '@app/core/plugins/plugin.service'
14import { POP_STATE_MODAL_DISMISS } from '@app/shared/misc/constants'
15import { WelcomeModalComponent } from '@app/modal/welcome-modal.component'
16import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component'
17import { CustomModalComponent } from '@app/modal/custom-modal.component' 11import { CustomModalComponent } from '@app/modal/custom-modal.component'
18import { ServerConfig, UserRole } from '@shared/models' 12import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component'
19import { User } from '@app/shared' 13import { WelcomeModalComponent } from '@app/modal/welcome-modal.component'
20import { InstanceService } from '@app/shared/instance/instance.service' 14import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
15import { I18n } from '@ngx-translate/i18n-polyfill'
16import { BroadcastMessageLevel, getShortLocale, is18nPath, ServerConfig, UserRole } from '@shared/models'
21import { MenuService } from './core/menu/menu.service' 17import { MenuService } from './core/menu/menu.service'
22import { BroadcastMessageLevel } from '@shared/models/server' 18import { peertubeLocalStorage, POP_STATE_MODAL_DISMISS } from './helpers'
23import { MarkdownService } from './shared/renderer' 19import { InstanceService } from './shared/shared-instance'
24import { concat } from 'rxjs'
25import { peertubeLocalStorage } from './shared/misc/peertube-web-storage'
26 20
27@Component({ 21@Component({
28 selector: 'my-app', 22 selector: 'my-app',
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index 89332ec5f..7fbc6463b 100644
--- a/client/src/app/app.module.ts
+++ b/client/src/app/app.module.ts
@@ -1,31 +1,36 @@
1import 'focus-visible'
2import { APP_BASE_HREF, registerLocaleData } from '@angular/common'
1import { LOCALE_ID, NgModule, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular/core' 3import { LOCALE_ID, NgModule, TRANSLATIONS, TRANSLATIONS_FORMAT } from '@angular/core'
2import { BrowserModule } from '@angular/platform-browser' 4import { BrowserModule } from '@angular/platform-browser'
3import { ServerService } from '@app/core' 5import { ServerService } from '@app/core'
6import localeOc from '@app/helpers/locales/oc'
4import { ResetPasswordModule } from '@app/reset-password' 7import { ResetPasswordModule } from '@app/reset-password'
8import { SearchModule } from '@app/search'
5import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core' 9import { MetaLoader, MetaModule, MetaStaticLoader, PageTitlePositioning } from '@ngx-meta/core'
6import 'focus-visible' 10import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '@shared/models'
7
8import { AppRoutingModule } from './app-routing.module' 11import { AppRoutingModule } from './app-routing.module'
9import { AppComponent } from './app.component' 12import { AppComponent } from './app.component'
10import { CoreModule } from './core' 13import { CoreModule } from './core'
11import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header' 14import { HeaderComponent, SearchTypeaheadComponent, SuggestionComponent } from './header'
12import { LoginModule } from './login' 15import { LoginModule } from './login'
13import { AvatarNotificationComponent, LanguageChooserComponent, MenuComponent } from './menu' 16import { AvatarNotificationComponent, LanguageChooserComponent, MenuComponent } from './menu'
14import { SharedModule } from './shared' 17import { ConfirmComponent } from './modal/confirm.component'
18import { CustomModalComponent } from './modal/custom-modal.component'
19import { InstanceConfigWarningModalComponent } from './modal/instance-config-warning-modal.component'
20import { QuickSettingsModalComponent } from './modal/quick-settings-modal.component'
21import { WelcomeModalComponent } from './modal/welcome-modal.component'
22import { SharedFormModule } from './shared/shared-forms'
23import { SharedGlobalIconModule } from './shared/shared-icons'
24import { SharedInstanceModule } from './shared/shared-instance'
25import { SharedMainModule } from './shared/shared-main'
26import { SharedUserInterfaceSettingsModule } from './shared/shared-user-settings'
15import { VideosModule } from './videos' 27import { VideosModule } from './videos'
16import { SearchModule } from '@app/search'
17import { WelcomeModalComponent } from '@app/modal/welcome-modal.component'
18import { InstanceConfigWarningModalComponent } from '@app/modal/instance-config-warning-modal.component'
19import { buildFileLocale, getCompleteLocale, isDefaultLocale } from '@shared/models'
20import { APP_BASE_HREF, registerLocaleData } from '@angular/common'
21import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component'
22import { CustomModalComponent } from '@app/modal/custom-modal.component'
23import localeOc from '@app/shared/locale/oc'
24 28
25registerLocaleData(localeOc, 'oc') 29registerLocaleData(localeOc, 'oc')
26 30
27@NgModule({ 31@NgModule({
28 bootstrap: [ AppComponent ], 32 bootstrap: [ AppComponent ],
33
29 declarations: [ 34 declarations: [
30 AppComponent, 35 AppComponent,
31 36
@@ -39,19 +44,24 @@ registerLocaleData(localeOc, 'oc')
39 44
40 CustomModalComponent, 45 CustomModalComponent,
41 WelcomeModalComponent, 46 WelcomeModalComponent,
42 InstanceConfigWarningModalComponent 47 InstanceConfigWarningModalComponent,
48 ConfirmComponent
43 ], 49 ],
50
44 imports: [ 51 imports: [
45 BrowserModule, 52 BrowserModule,
46 53
47 CoreModule, 54 CoreModule,
48 SharedModule, 55 SharedMainModule,
56 SharedFormModule,
57 SharedUserInterfaceSettingsModule,
58 SharedGlobalIconModule,
59 SharedInstanceModule,
49 60
50 CoreModule,
51 LoginModule, 61 LoginModule,
52 ResetPasswordModule, 62 ResetPasswordModule,
53 SearchModule, 63 SearchModule,
54 SharedModule, 64
55 VideosModule, 65 VideosModule,
56 66
57 MetaModule.forRoot({ 67 MetaModule.forRoot({
diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts
index 4ad904beb..4e7801550 100644
--- a/client/src/app/core/auth/auth-user.model.ts
+++ b/client/src/app/core/auth/auth-user.model.ts
@@ -1,10 +1,14 @@
1import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' 1import { User } from '@app/core/users/user.model'
2import { UserRight } from '../../../../../shared/models/users/user-right.enum' 2import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage'
3import { MyUser as ServerMyUserModel, User as ServerUserModel, MyUserSpecialPlaylist } from '../../../../../shared/models/users/user.model' 3import {
4// Do not use the barrel (dependency loop) 4 hasUserRight,
5import { hasUserRight, UserRole } from '../../../../../shared/models/users/user-role' 5 MyUser as ServerMyUserModel,
6import { User } from '../../shared/users/user.model' 6 MyUserSpecialPlaylist,
7import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' 7 NSFWPolicyType,
8 User as ServerUserModel,
9 UserRight,
10 UserRole
11} from '@shared/models'
8 12
9export type TokenOptions = { 13export type TokenOptions = {
10 accessToken: string 14 accessToken: string
diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts
index de8c509d1..94262b9aa 100644
--- a/client/src/app/core/auth/auth.service.ts
+++ b/client/src/app/core/auth/auth.service.ts
@@ -1,20 +1,17 @@
1import { Hotkey, HotkeysService } from 'angular2-hotkeys'
1import { Observable, ReplaySubject, Subject, throwError as observableThrowError } from 'rxjs' 2import { Observable, ReplaySubject, Subject, throwError as observableThrowError } from 'rxjs'
2import { catchError, map, mergeMap, share, tap } from 'rxjs/operators' 3import { catchError, map, mergeMap, share, tap } from 'rxjs/operators'
3import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'
4import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
5import { Router } from '@angular/router' 6import { Router } from '@angular/router'
6import { Notifier } from '@app/core/notification/notifier.service' 7import { Notifier } from '@app/core/notification/notifier.service'
7import { OAuthClientLocal, MyUser as UserServerModel, UserRefreshToken } from '../../../../../shared' 8import { objectToUrlEncoded, peertubeLocalStorage } from '@app/helpers'
8import { User } from '../../../../../shared/models/users' 9import { I18n } from '@ngx-translate/i18n-polyfill'
9import { UserLogin } from '../../../../../shared/models/users/user-login.model' 10import { MyUser as UserServerModel, OAuthClientLocal, User, UserLogin, UserRefreshToken } from '@shared/models'
10import { environment } from '../../../environments/environment' 11import { environment } from '../../../environments/environment'
11import { RestExtractor } from '../../shared/rest/rest-extractor.service' 12import { RestExtractor } from '../rest/rest-extractor.service'
12import { AuthStatus } from './auth-status.model' 13import { AuthStatus } from './auth-status.model'
13import { AuthUser } from './auth-user.model' 14import { AuthUser } from './auth-user.model'
14import { objectToUrlEncoded } from '@app/shared/misc/utils'
15import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage'
16import { I18n } from '@ngx-translate/i18n-polyfill'
17import { Hotkey, HotkeysService } from 'angular2-hotkeys'
18 15
19interface UserLoginWithUsername extends UserLogin { 16interface UserLoginWithUsername extends UserLogin {
20 access_token: string 17 access_token: string
diff --git a/client/src/app/core/core.module.ts b/client/src/app/core/core.module.ts
index a1734ad80..22896e2e9 100644
--- a/client/src/app/core/core.module.ts
+++ b/client/src/app/core/core.module.ts
@@ -1,35 +1,35 @@
1import { HotkeyModule } from 'angular2-hotkeys'
2import { MessageService } from 'primeng/api'
3import { ToastModule } from 'primeng/toast'
1import { CommonModule } from '@angular/common' 4import { CommonModule } from '@angular/common'
2import { NgModule, Optional, SkipSelf } from '@angular/core' 5import { NgModule, Optional, SkipSelf } from '@angular/core'
3import { FormsModule } from '@angular/forms'
4import { BrowserAnimationsModule } from '@angular/platform-browser/animations' 6import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
5import { RouterModule } from '@angular/router' 7import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service'
8import { HooksService } from '@app/core/plugins/hooks.service'
9import { PluginService } from '@app/core/plugins/plugin.service'
10import { UnloggedGuard } from '@app/core/routing/unlogged-guard.service'
6import { LoadingBarModule } from '@ngx-loading-bar/core' 11import { LoadingBarModule } from '@ngx-loading-bar/core'
7import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client' 12import { LoadingBarHttpClientModule } from '@ngx-loading-bar/http-client'
8import { LoadingBarRouterModule } from '@ngx-loading-bar/router' 13import { LoadingBarRouterModule } from '@ngx-loading-bar/router'
9
10import { AuthService } from './auth' 14import { AuthService } from './auth'
11import { ConfirmService } from './confirm' 15import { ConfirmService } from './confirm'
16import { CheatSheetComponent } from './hotkeys'
17import { MenuService } from './menu'
12import { throwIfAlreadyLoaded } from './module-import-guard' 18import { throwIfAlreadyLoaded } from './module-import-guard'
19import { Notifier } from './notification'
20import { HtmlRendererService, LinkifierService, MarkdownService } from './renderer'
21import { RestExtractor, RestService } from './rest'
13import { LoginGuard, RedirectService, UserRightGuard } from './routing' 22import { LoginGuard, RedirectService, UserRightGuard } from './routing'
23import { CanDeactivateGuard } from './routing/can-deactivate-guard.service'
24import { ServerConfigResolver } from './routing/server-config-resolver.service'
14import { ServerService } from './server' 25import { ServerService } from './server'
15import { ThemeService } from './theme' 26import { ThemeService } from './theme'
16import { MenuService } from './menu' 27import { UserService } from './users'
17import { HotkeyModule } from 'angular2-hotkeys' 28import { LocalStorageService, ScreenService, SessionStorageService } from './wrappers'
18import { CheatSheetComponent } from './hotkeys'
19import { ToastModule } from 'primeng/toast'
20import { Notifier } from './notification'
21import { MessageService } from 'primeng/api'
22import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service'
23import { ServerConfigResolver } from './routing/server-config-resolver.service'
24import { UnloggedGuard } from '@app/core/routing/unlogged-guard.service'
25import { PluginService } from '@app/core/plugins/plugin.service'
26import { HooksService } from '@app/core/plugins/hooks.service'
27 29
28@NgModule({ 30@NgModule({
29 imports: [ 31 imports: [
30 CommonModule, 32 CommonModule,
31 RouterModule,
32 FormsModule,
33 BrowserAnimationsModule, 33 BrowserAnimationsModule,
34 34
35 LoadingBarHttpClientModule, 35 LoadingBarHttpClientModule,
@@ -68,11 +68,25 @@ import { HooksService } from '@app/core/plugins/hooks.service'
68 PluginService, 68 PluginService,
69 HooksService, 69 HooksService,
70 70
71 HtmlRendererService,
72 LinkifierService,
73 MarkdownService,
74
75 RestExtractor,
76 RestService,
77
78 UserService,
79
80 ScreenService,
81 LocalStorageService,
82 SessionStorageService,
83
71 RedirectService, 84 RedirectService,
72 Notifier, 85 Notifier,
73 MessageService, 86 MessageService,
74 UserNotificationSocket, 87 UserNotificationSocket,
75 ServerConfigResolver 88 ServerConfigResolver,
89 CanDeactivateGuard
76 ] 90 ]
77}) 91})
78export class CoreModule { 92export class CoreModule {
diff --git a/client/src/app/core/index.ts b/client/src/app/core/index.ts
index f664aff41..a0c34543d 100644
--- a/client/src/app/core/index.ts
+++ b/client/src/app/core/index.ts
@@ -1,8 +1,15 @@
1export * from './auth' 1export * from './auth'
2export * from './confirm' 2export * from './confirm'
3export * from './hotkeys'
4export * from './menu'
5export * from './notification'
6export * from './plugins'
7export * from './renderer'
8export * from './rest'
3export * from './routing' 9export * from './routing'
4export * from './server' 10export * from './server'
5export * from './notification'
6export * from './theme' 11export * from './theme'
12export * from './users'
13export * from './wrappers'
7 14
8export * from './core.module' 15export * from './core.module'
diff --git a/client/src/app/core/menu/menu.service.ts b/client/src/app/core/menu/menu.service.ts
index 81093c666..ef5271f97 100644
--- a/client/src/app/core/menu/menu.service.ts
+++ b/client/src/app/core/menu/menu.service.ts
@@ -1,7 +1,7 @@
1import { Injectable } from '@angular/core'
2import { ScreenService } from '@app/shared/misc/screen.service'
3import { fromEvent } from 'rxjs' 1import { fromEvent } from 'rxjs'
4import { debounceTime } from 'rxjs/operators' 2import { debounceTime } from 'rxjs/operators'
3import { Injectable } from '@angular/core'
4import { ScreenService } from '../wrappers'
5 5
6@Injectable() 6@Injectable()
7export class MenuService { 7export class MenuService {
diff --git a/client/src/app/core/notification/user-notification-socket.service.ts b/client/src/app/core/notification/user-notification-socket.service.ts
index 3f22da476..37f0bc32c 100644
--- a/client/src/app/core/notification/user-notification-socket.service.ts
+++ b/client/src/app/core/notification/user-notification-socket.service.ts
@@ -1,7 +1,7 @@
1import { Subject } from 'rxjs'
1import { Injectable, NgZone } from '@angular/core' 2import { Injectable, NgZone } from '@angular/core'
3import { UserNotification as UserNotificationServer } from '@shared/models'
2import { environment } from '../../../environments/environment' 4import { environment } from '../../../environments/environment'
3import { UserNotification as UserNotificationServer } from '../../../../../shared'
4import { Subject } from 'rxjs'
5import { AuthService } from '../auth' 5import { AuthService } from '../auth'
6 6
7export type NotificationEvent = 'new' | 'read' | 'read-all' 7export type NotificationEvent = 'new' | 'read' | 'read-all'
diff --git a/client/src/app/core/plugins/hooks.service.ts b/client/src/app/core/plugins/hooks.service.ts
index 2fbf406d1..ec47aa48c 100644
--- a/client/src/app/core/plugins/hooks.service.ts
+++ b/client/src/app/core/plugins/hooks.service.ts
@@ -2,8 +2,7 @@ import { from, Observable } from 'rxjs'
2import { mergeMap, switchMap } from 'rxjs/operators' 2import { mergeMap, switchMap } from 'rxjs/operators'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { PluginService } from '@app/core/plugins/plugin.service' 4import { PluginService } from '@app/core/plugins/plugin.service'
5import { ClientActionHookName, ClientFilterHookName } from '@shared/models/plugins/client-hook.model' 5import { ClientActionHookName, ClientFilterHookName, PluginClientScope } from '@shared/models'
6import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type'
7 6
8type RawFunction<U, T> = (params: U) => T 7type RawFunction<U, T> = (params: U) => T
9type ObservableFunction<U, T> = RawFunction<U, Observable<T>> 8type ObservableFunction<U, T> = RawFunction<U, Observable<T>>
diff --git a/client/src/app/core/plugins/index.ts b/client/src/app/core/plugins/index.ts
new file mode 100644
index 000000000..b3239f1f3
--- /dev/null
+++ b/client/src/app/core/plugins/index.ts
@@ -0,0 +1,2 @@
1export * from './hooks.service'
2export * from './plugin.service'
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts
index c6efcac6d..3cab64142 100644
--- a/client/src/app/core/plugins/plugin.service.ts
+++ b/client/src/app/core/plugins/plugin.service.ts
@@ -1,28 +1,33 @@
1import { Inject, Injectable, LOCALE_ID, NgZone } from '@angular/core'
2import { Router } from '@angular/router'
3import { getCompleteLocale, isDefaultLocale, peertubeTranslate, ServerConfigPlugin } from '@shared/models'
4import { ServerService } from '@app/core/server/server.service'
5import { ClientScript } from '@shared/models/plugins/plugin-package-json.model'
6import { ClientScript as ClientScriptModule } from '../../../types/client-script.model'
7import { environment } from '../../../environments/environment'
8import { Observable, of, ReplaySubject } from 'rxjs' 1import { Observable, of, ReplaySubject } from 'rxjs'
9import { catchError, first, map, shareReplay } from 'rxjs/operators' 2import { catchError, first, map, shareReplay } from 'rxjs/operators'
10import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks'
11import { ClientHook, ClientHookName, clientHookObject } from '@shared/models/plugins/client-hook.model'
12import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type'
13import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model'
14import { HttpClient } from '@angular/common/http' 3import { HttpClient } from '@angular/common/http'
4import { Inject, Injectable, LOCALE_ID, NgZone } from '@angular/core'
15import { AuthService } from '@app/core/auth' 5import { AuthService } from '@app/core/auth'
16import { Notifier } from '@app/core/notification' 6import { Notifier } from '@app/core/notification'
17import { RestExtractor } from '@app/shared/rest' 7import { MarkdownService } from '@app/core/renderer'
18import { MarkdownService } from '@app/shared/renderer' 8import { RestExtractor } from '@app/core/rest'
19import { PluginType } from '@shared/models/plugins/plugin.type' 9import { ServerService } from '@app/core/server/server.service'
20import { PublicServerSetting } from '@shared/models/plugins/public-server.setting' 10import { getDevLocale, importModule, isOnDevLocale } from '@app/helpers'
21import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
22import { RegisterClientHelpers } from '../../../types/register-client-option.model'
23import { PluginTranslation } from '@shared/models/plugins/plugin-translation.model'
24import { importModule } from '@app/shared/misc/utils'
25import { CustomModalComponent } from '@app/modal/custom-modal.component' 11import { CustomModalComponent } from '@app/modal/custom-modal.component'
12import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks'
13import {
14 ClientHook,
15 ClientHookName,
16 clientHookObject,
17 ClientScript,
18 getCompleteLocale,
19 isDefaultLocale,
20 peertubeTranslate,
21 PluginClientScope,
22 PluginTranslation,
23 PluginType,
24 PublicServerSetting,
25 RegisterClientHookOptions,
26 ServerConfigPlugin
27} from '@shared/models'
28import { environment } from '../../../environments/environment'
29import { ClientScript as ClientScriptModule } from '../../../types/client-script.model'
30import { RegisterClientHelpers } from '../../../types/register-client-option.model'
26 31
27interface HookStructValue extends RegisterClientHookOptions { 32interface HookStructValue extends RegisterClientHookOptions {
28 plugin: ServerConfigPlugin 33 plugin: ServerConfigPlugin
@@ -64,7 +69,6 @@ export class PluginService implements ClientHook {
64 private hooks: { [ name: string ]: HookStructValue[] } = {} 69 private hooks: { [ name: string ]: HookStructValue[] } = {}
65 70
66 constructor ( 71 constructor (
67 private router: Router,
68 private authService: AuthService, 72 private authService: AuthService,
69 private notifier: Notifier, 73 private notifier: Notifier,
70 private markdownRenderer: MarkdownService, 74 private markdownRenderer: MarkdownService,
diff --git a/client/src/app/shared/renderer/html-renderer.service.ts b/client/src/app/core/renderer/html-renderer.service.ts
index 1ddd8fe2f..f0527c759 100644
--- a/client/src/app/shared/renderer/html-renderer.service.ts
+++ b/client/src/app/core/renderer/html-renderer.service.ts
@@ -1,5 +1,5 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { LinkifierService } from '@app/shared/renderer/linkifier.service' 2import { LinkifierService } from './linkifier.service'
3 3
4@Injectable() 4@Injectable()
5export class HtmlRendererService { 5export class HtmlRendererService {
diff --git a/client/src/app/shared/renderer/index.ts b/client/src/app/core/renderer/index.ts
index 39202b385..39202b385 100644
--- a/client/src/app/shared/renderer/index.ts
+++ b/client/src/app/core/renderer/index.ts
diff --git a/client/src/app/shared/renderer/linkifier.service.ts b/client/src/app/core/renderer/linkifier.service.ts
index 95d5f17cc..46d5b0089 100644
--- a/client/src/app/shared/renderer/linkifier.service.ts
+++ b/client/src/app/core/renderer/linkifier.service.ts
@@ -1,5 +1,5 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { getAbsoluteAPIUrl } from '@app/shared/misc/utils' 2import { getAbsoluteAPIUrl } from '@app/helpers/utils'
3import * as linkify from 'linkifyjs' 3import * as linkify from 'linkifyjs'
4import linkifyHtml from 'linkifyjs/html' 4import linkifyHtml from 'linkifyjs/html'
5 5
diff --git a/client/src/app/shared/renderer/markdown.service.ts b/client/src/app/core/renderer/markdown.service.ts
index f0c87326f..0c43bebab 100644
--- a/client/src/app/shared/renderer/markdown.service.ts
+++ b/client/src/app/core/renderer/markdown.service.ts
@@ -1,7 +1,7 @@
1import { Injectable } from '@angular/core'
2import { buildVideoLink } from '../../../assets/player/utils'
3import { HtmlRendererService } from '@app/shared/renderer/html-renderer.service'
4import * as MarkdownIt from 'markdown-it' 1import * as MarkdownIt from 'markdown-it'
2import { buildVideoLink } from 'src/assets/player/utils'
3import { Injectable } from '@angular/core'
4import { HtmlRendererService } from './html-renderer.service'
5 5
6type MarkdownParsers = { 6type MarkdownParsers = {
7 textMarkdownIt: MarkdownIt 7 textMarkdownIt: MarkdownIt
diff --git a/client/src/app/shared/rest/component-pagination.model.ts b/client/src/app/core/rest/component-pagination.model.ts
index bcb73ed0f..bcb73ed0f 100644
--- a/client/src/app/shared/rest/component-pagination.model.ts
+++ b/client/src/app/core/rest/component-pagination.model.ts
diff --git a/client/src/app/shared/rest/index.ts b/client/src/app/core/rest/index.ts
index f00cda2b8..93899beaf 100644
--- a/client/src/app/shared/rest/index.ts
+++ b/client/src/app/core/rest/index.ts
@@ -1,4 +1,5 @@
1export * from './component-pagination.model'
1export * from './rest-extractor.service' 2export * from './rest-extractor.service'
2export * from './rest-pagination' 3export * from './rest-pagination'
3export * from './rest.service'
4export * from './rest-table' 4export * from './rest-table'
5export * from './rest.service'
diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/core/rest/rest-extractor.service.ts
index e6518dd1d..9de964f79 100644
--- a/client/src/app/shared/rest/rest-extractor.service.ts
+++ b/client/src/app/core/rest/rest-extractor.service.ts
@@ -1,9 +1,9 @@
1import { throwError as observableThrowError } from 'rxjs' 1import { throwError as observableThrowError } from 'rxjs'
2import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
3import { dateToHuman } from '@app/shared/misc/utils'
4import { ResultList } from '../../../../../shared'
5import { Router } from '@angular/router' 3import { Router } from '@angular/router'
4import { dateToHuman } from '@app/helpers'
6import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { ResultList } from '@shared/models'
7 7
8@Injectable() 8@Injectable()
9export class RestExtractor { 9export class RestExtractor {
diff --git a/client/src/app/shared/rest/rest-pagination.ts b/client/src/app/core/rest/rest-pagination.ts
index 0faa59303..0faa59303 100644
--- a/client/src/app/shared/rest/rest-pagination.ts
+++ b/client/src/app/core/rest/rest-pagination.ts
diff --git a/client/src/app/shared/rest/rest-table.ts b/client/src/app/core/rest/rest-table.ts
index d4e6cf5f2..1b35ad47d 100644
--- a/client/src/app/shared/rest/rest-table.ts
+++ b/client/src/app/core/rest/rest-table.ts
@@ -1,4 +1,4 @@
1import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' 1import { peertubeLocalStorage } from '@app/helpers/peertube-web-storage'
2import { LazyLoadEvent, SortMeta } from 'primeng/api' 2import { LazyLoadEvent, SortMeta } from 'primeng/api'
3import { RestPagination } from './rest-pagination' 3import { RestPagination } from './rest-pagination'
4import { Subject } from 'rxjs' 4import { Subject } from 'rxjs'
diff --git a/client/src/app/shared/rest/rest.service.ts b/client/src/app/core/rest/rest.service.ts
index 78558851a..78558851a 100644
--- a/client/src/app/shared/rest/rest.service.ts
+++ b/client/src/app/core/rest/rest.service.ts
diff --git a/client/src/app/shared/guards/can-deactivate-guard.service.ts b/client/src/app/core/routing/can-deactivate-guard.service.ts
index 3a35fcfb3..e0405293a 100644
--- a/client/src/app/shared/guards/can-deactivate-guard.service.ts
+++ b/client/src/app/core/routing/can-deactivate-guard.service.ts
@@ -1,7 +1,7 @@
1import { Observable } from 'rxjs'
1import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
2import { CanDeactivate } from '@angular/router' 3import { CanDeactivate } from '@angular/router'
3import { Observable } from 'rxjs' 4import { ConfirmService } from '@app/core/confirm'
4import { ConfirmService } from '../../core/index'
5import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6 6
7export type CanComponentDeactivateResult = { text?: string, canDeactivate: Observable<boolean> | boolean } 7export type CanComponentDeactivateResult = { text?: string, canDeactivate: Observable<boolean> | boolean }
diff --git a/client/src/app/core/routing/index.ts b/client/src/app/core/routing/index.ts
index 58b83bb2a..239c27caf 100644
--- a/client/src/app/core/routing/index.ts
+++ b/client/src/app/core/routing/index.ts
@@ -1,5 +1,10 @@
1export * from './can-deactivate-guard.service'
2export * from './custom-reuse-strategy'
3export * from './disable-for-reuse-hook'
1export * from './login-guard.service' 4export * from './login-guard.service'
2export * from './user-right-guard.service' 5export * from './menu-guard.service'
3export * from './preload-selected-modules-list' 6export * from './preload-selected-modules-list'
4export * from './redirect.service' 7export * from './redirect.service'
5export * from './menu-guard.service' 8export * from './server-config-resolver.service'
9export * from './unlogged-guard.service'
10export * from './user-right-guard.service'
diff --git a/client/src/app/core/routing/login-guard.service.ts b/client/src/app/core/routing/login-guard.service.ts
index 7b1c37ee8..a949be14c 100644
--- a/client/src/app/core/routing/login-guard.service.ts
+++ b/client/src/app/core/routing/login-guard.service.ts
@@ -1,6 +1,5 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router' 2import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router'
3
4import { AuthService } from '../auth/auth.service' 3import { AuthService } from '../auth/auth.service'
5 4
6@Injectable() 5@Injectable()
diff --git a/client/src/app/core/routing/menu-guard.service.ts b/client/src/app/core/routing/menu-guard.service.ts
index 907d145fd..9df285635 100644
--- a/client/src/app/core/routing/menu-guard.service.ts
+++ b/client/src/app/core/routing/menu-guard.service.ts
@@ -1,7 +1,7 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { CanActivate, CanDeactivate } from '@angular/router' 2import { CanActivate, CanDeactivate } from '@angular/router'
3import { MenuService } from '@app/core/menu' 3import { MenuService } from '../menu'
4import { ScreenService } from '@app/shared/misc/screen.service' 4import { ScreenService } from '../wrappers'
5 5
6abstract class MenuGuard implements CanActivate, CanDeactivate<any> { 6abstract class MenuGuard implements CanActivate, CanDeactivate<any> {
7 display = true 7 display = true
diff --git a/client/src/app/core/routing/preload-selected-modules-list.ts b/client/src/app/core/routing/preload-selected-modules-list.ts
index 64af68225..b494a40bc 100644
--- a/client/src/app/core/routing/preload-selected-modules-list.ts
+++ b/client/src/app/core/routing/preload-selected-modules-list.ts
@@ -5,6 +5,7 @@ import { Injectable } from '@angular/core'
5 5
6@Injectable() 6@Injectable()
7export class PreloadSelectedModulesList implements PreloadingStrategy { 7export class PreloadSelectedModulesList implements PreloadingStrategy {
8
8 preload (route: Route, load: Function): Observable<any> { 9 preload (route: Route, load: Function): Observable<any> {
9 if (!route.data || !route.data.preload) return ofObservable(null) 10 if (!route.data || !route.data.preload) return ofObservable(null)
10 11
diff --git a/client/src/app/core/routing/server-config-resolver.service.ts b/client/src/app/core/routing/server-config-resolver.service.ts
index 3b7ed99bf..0ce2023a0 100644
--- a/client/src/app/core/routing/server-config-resolver.service.ts
+++ b/client/src/app/core/routing/server-config-resolver.service.ts
@@ -1,6 +1,6 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { Resolve } from '@angular/router' 2import { Resolve } from '@angular/router'
3import { ServerService } from '@app/core/server' 3import { ServerService } from '../server'
4import { ServerConfig } from '@shared/models' 4import { ServerConfig } from '@shared/models'
5 5
6@Injectable() 6@Injectable()
diff --git a/client/src/app/core/routing/unlogged-guard.service.ts b/client/src/app/core/routing/unlogged-guard.service.ts
index 3132a1a77..0be7911a0 100644
--- a/client/src/app/core/routing/unlogged-guard.service.ts
+++ b/client/src/app/core/routing/unlogged-guard.service.ts
@@ -1,5 +1,5 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router' 2import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router'
3import { AuthService } from '../auth/auth.service' 3import { AuthService } from '../auth/auth.service'
4import { RedirectService } from './redirect.service' 4import { RedirectService } from './redirect.service'
5 5
@@ -7,7 +7,6 @@ import { RedirectService } from './redirect.service'
7export class UnloggedGuard implements CanActivate, CanActivateChild { 7export class UnloggedGuard implements CanActivate, CanActivateChild {
8 8
9 constructor ( 9 constructor (
10 private router: Router,
11 private auth: AuthService, 10 private auth: AuthService,
12 private redirectService: RedirectService 11 private redirectService: RedirectService
13 ) {} 12 ) {}
diff --git a/client/src/app/core/routing/user-right-guard.service.ts b/client/src/app/core/routing/user-right-guard.service.ts
index 50c3d8c19..a2ce772db 100644
--- a/client/src/app/core/routing/user-right-guard.service.ts
+++ b/client/src/app/core/routing/user-right-guard.service.ts
@@ -1,12 +1,5 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { 2import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router, RouterStateSnapshot } from '@angular/router'
3 ActivatedRouteSnapshot,
4 CanActivateChild,
5 RouterStateSnapshot,
6 CanActivate,
7 Router
8} from '@angular/router'
9
10import { AuthService } from '../auth/auth.service' 3import { AuthService } from '../auth/auth.service'
11 4
12@Injectable() 5@Injectable()
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index a804efd28..32a135203 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -2,14 +2,16 @@ import { Observable, of, Subject } from 'rxjs'
2import { first, map, share, shareReplay, switchMap, tap } from 'rxjs/operators' 2import { first, map, share, shareReplay, switchMap, tap } from 'rxjs/operators'
3import { HttpClient } from '@angular/common/http' 3import { HttpClient } from '@angular/common/http'
4import { Inject, Injectable, LOCALE_ID } from '@angular/core' 4import { Inject, Injectable, LOCALE_ID } from '@angular/core'
5import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' 5import { getDevLocale, isOnDevLocale, peertubeLocalStorage, sortBy } from '@app/helpers'
6import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' 6import {
7import { sortBy } from '@app/shared/misc/utils' 7 getCompleteLocale,
8import { SearchTargetType } from '@shared/models/search/search-target-query.model' 8 isDefaultLocale,
9import { ServerStats } from '@shared/models/server' 9 peertubeTranslate,
10import { getCompleteLocale, ServerConfig } from '../../../../../shared' 10 SearchTargetType,
11import { isDefaultLocale, peertubeTranslate } from '../../../../../shared/models/i18n' 11 ServerConfig,
12import { VideoConstant } from '../../../../../shared/models/videos' 12 ServerStats,
13 VideoConstant
14} from '@shared/models'
13import { environment } from '../../../environments/environment' 15import { environment } from '../../../environments/environment'
14 16
15@Injectable() 17@Injectable()
diff --git a/client/src/app/core/theme/theme.service.ts b/client/src/app/core/theme/theme.service.ts
index c0189ad32..9dbf22e20 100644
--- a/client/src/app/core/theme/theme.service.ts
+++ b/client/src/app/core/theme/theme.service.ts
@@ -1,13 +1,13 @@
1import { first } from 'rxjs/operators'
1import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
2import { AuthService } from '@app/core/auth' 3import { AuthService } from '../auth'
3import { ServerService } from '@app/core/server' 4import { PluginService } from '../plugins/plugin.service'
4import { environment } from '../../../environments/environment' 5import { ServerService } from '../server'
5import { PluginService } from '@app/core/plugins/plugin.service' 6import { LocalStorageService } from '../wrappers/storage.service'
7import { User } from '../users/user.model'
8import { UserService } from '../users/user.service'
6import { ServerConfig, ServerConfigTheme } from '@shared/models' 9import { ServerConfig, ServerConfigTheme } from '@shared/models'
7import { first } from 'rxjs/operators' 10import { environment } from '../../../environments/environment'
8import { User } from '@app/shared/users/user.model'
9import { UserService } from '@app/shared/users/user.service'
10import { LocalStorageService } from '@app/shared/misc/storage.service'
11 11
12@Injectable() 12@Injectable()
13export class ThemeService { 13export class ThemeService {
diff --git a/client/src/app/shared/users/index.ts b/client/src/app/core/users/index.ts
index ebd715fb1..7b5a67bc7 100644
--- a/client/src/app/shared/users/index.ts
+++ b/client/src/app/core/users/index.ts
@@ -1,3 +1,2 @@
1export * from './user.model' 1export * from './user.model'
2export * from './user.service' 2export * from './user.service'
3export * from './user-notifications.component'
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/core/users/user.model.ts
index 3348fe75f..8ecdf9fcd 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/core/users/user.model.ts
@@ -1,15 +1,15 @@
1import { Account } from '@app/shared/shared-main/account/account.model'
1import { 2import {
3 Avatar,
2 hasUserRight, 4 hasUserRight,
5 NSFWPolicyType,
3 User as UserServerModel, 6 User as UserServerModel,
7 UserAdminFlag,
4 UserNotificationSetting, 8 UserNotificationSetting,
5 UserRight, 9 UserRight,
6 UserRole 10 UserRole,
7} from '../../../../../shared/models/users' 11 VideoChannel
8import { VideoChannel } from '../../../../../shared/models/videos' 12} from '@shared/models'
9import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type'
10import { Account } from '@app/shared/account/account.model'
11import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
12import { UserAdminFlag } from '@shared/models/users/user-flag.model'
13 13
14export class User implements UserServerModel { 14export class User implements UserServerModel {
15 static KEYS = { 15 static KEYS = {
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/core/users/user.service.ts
index de1c8ec94..ab395b1f9 100644
--- a/client/src/app/shared/users/user.service.ts
+++ b/client/src/app/core/users/user.service.ts
@@ -2,18 +2,26 @@ import { has } from 'lodash-es'
2import { BytesPipe } from 'ngx-pipes' 2import { BytesPipe } from 'ngx-pipes'
3import { SortMeta } from 'primeng/api' 3import { SortMeta } from 'primeng/api'
4import { from, Observable, of } from 'rxjs' 4import { from, Observable, of } from 'rxjs'
5import { catchError, concatMap, first, map, shareReplay, toArray, throttleTime, filter } from 'rxjs/operators' 5import { catchError, concatMap, filter, first, map, shareReplay, throttleTime, toArray } from 'rxjs/operators'
6import { HttpClient, HttpParams } from '@angular/common/http' 6import { HttpClient, HttpParams } from '@angular/common/http'
7import { Injectable } from '@angular/core' 7import { Injectable } from '@angular/core'
8import { AuthService } from '@app/core/auth' 8import { AuthService } from '@app/core/auth'
9import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { UserRegister } from '@shared/models/users/user-register.model' 10import {
11import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type' 11 Avatar,
12import { ResultList, User as UserServerModel, UserCreate, UserRole, UserUpdate, UserUpdateMe, UserVideoQuota } from '../../../../../shared' 12 NSFWPolicyType,
13import { Avatar } from '../../../../../shared/models/avatars/avatar.model' 13 ResultList,
14 User as UserServerModel,
15 UserCreate,
16 UserRegister,
17 UserRole,
18 UserUpdate,
19 UserUpdateMe,
20 UserVideoQuota
21} from '@shared/models'
14import { environment } from '../../../environments/environment' 22import { environment } from '../../../environments/environment'
15import { LocalStorageService, SessionStorageService } from '../misc/storage.service'
16import { RestExtractor, RestPagination, RestService } from '../rest' 23import { RestExtractor, RestPagination, RestService } from '../rest'
24import { LocalStorageService, SessionStorageService } from '../wrappers/storage.service'
17import { User } from './user.model' 25import { User } from './user.model'
18 26
19@Injectable() 27@Injectable()
diff --git a/client/src/app/core/wrappers/index.ts b/client/src/app/core/wrappers/index.ts
new file mode 100644
index 000000000..d82b70070
--- /dev/null
+++ b/client/src/app/core/wrappers/index.ts
@@ -0,0 +1,2 @@
1export * from './screen.service'
2export * from './storage.service'
diff --git a/client/src/app/shared/misc/screen.service.ts b/client/src/app/core/wrappers/screen.service.ts
index a69fad31d..a69fad31d 100644
--- a/client/src/app/shared/misc/screen.service.ts
+++ b/client/src/app/core/wrappers/screen.service.ts
diff --git a/client/src/app/shared/misc/storage.service.ts b/client/src/app/core/wrappers/storage.service.ts
index 0d4a8ab53..9a60b9785 100644
--- a/client/src/app/shared/misc/storage.service.ts
+++ b/client/src/app/core/wrappers/storage.service.ts
@@ -1,10 +1,7 @@
1import { Injectable } from '@angular/core'
2import { Observable, Subject } from 'rxjs' 1import { Observable, Subject } from 'rxjs'
3import {
4 peertubeLocalStorage,
5 peertubeSessionStorage
6} from './peertube-web-storage'
7import { filter } from 'rxjs/operators' 2import { filter } from 'rxjs/operators'
3import { Injectable } from '@angular/core'
4import { peertubeLocalStorage, peertubeSessionStorage } from '@app/helpers'
8 5
9abstract class StorageService { 6abstract class StorageService {
10 protected instance: Storage 7 protected instance: Storage
diff --git a/client/src/app/header/search-typeahead.component.ts b/client/src/app/header/search-typeahead.component.ts
index 7d04e0f6d..c546628ee 100644
--- a/client/src/app/header/search-typeahead.component.ts
+++ b/client/src/app/header/search-typeahead.component.ts
@@ -1,11 +1,10 @@
1import { of } from 'rxjs' 1import { of } from 'rxjs'
2import { first, tap, delay } from 'rxjs/operators' 2import { first, tap } from 'rxjs/operators'
3import { ListKeyManager } from '@angular/cdk/a11y' 3import { ListKeyManager } from '@angular/cdk/a11y'
4import { AfterViewInit, Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChild, ViewChildren, AfterViewChecked } from '@angular/core' 4import { AfterViewChecked, AfterViewInit, Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core'
5import { ActivatedRoute, Params, Router } from '@angular/router' 5import { ActivatedRoute, Params, Router } from '@angular/router'
6import { AuthService, ServerService } from '@app/core' 6import { AuthService, ServerService } from '@app/core'
7import { ServerConfig } from '@shared/models' 7import { SearchTargetType, ServerConfig } from '@shared/models'
8import { SearchTargetType } from '@shared/models/search/search-target-query.model'
9import { SuggestionComponent, SuggestionPayload, SuggestionPayloadType } from './suggestion.component' 8import { SuggestionComponent, SuggestionPayload, SuggestionPayloadType } from './suggestion.component'
10 9
11@Component({ 10@Component({
diff --git a/client/src/app/header/suggestion.component.ts b/client/src/app/header/suggestion.component.ts
index 250a5411e..c874212a5 100644
--- a/client/src/app/header/suggestion.component.ts
+++ b/client/src/app/header/suggestion.component.ts
@@ -1,6 +1,6 @@
1import { Input, Component, Output, EventEmitter, OnInit, ChangeDetectionStrategy, OnChanges } from '@angular/core'
2import { RouterLink } from '@angular/router'
3import { ListKeyManagerOption } from '@angular/cdk/a11y' 1import { ListKeyManagerOption } from '@angular/cdk/a11y'
2import { Component, Input, OnInit } from '@angular/core'
3import { RouterLink } from '@angular/router'
4 4
5export type SuggestionPayload = { 5export type SuggestionPayload = {
6 text: string 6 text: string
diff --git a/client/src/app/shared/misc/constants.ts b/client/src/app/helpers/constants.ts
index bb4a0884e..bb4a0884e 100644
--- a/client/src/app/shared/misc/constants.ts
+++ b/client/src/app/helpers/constants.ts
diff --git a/client/src/app/shared/i18n/i18n-utils.ts b/client/src/app/helpers/i18n-utils.ts
index 30d65a2a2..bbfb12959 100644
--- a/client/src/app/shared/i18n/i18n-utils.ts
+++ b/client/src/app/helpers/i18n-utils.ts
@@ -1,4 +1,4 @@
1import { environment } from '../../../environments/environment' 1import { environment } from '../../environments/environment'
2 2
3function isOnDevLocale () { 3function isOnDevLocale () {
4 return environment.production === false && window.location.search === '?lang=fr' 4 return environment.production === false && window.location.search === '?lang=fr'
diff --git a/client/src/app/helpers/index.ts b/client/src/app/helpers/index.ts
new file mode 100644
index 000000000..06806402e
--- /dev/null
+++ b/client/src/app/helpers/index.ts
@@ -0,0 +1,6 @@
1export * from './locales'
2export * from './constants'
3export * from './i18n-utils'
4export * from './peertube-web-storage'
5export * from './utils'
6export * from './zone'
diff --git a/client/src/app/helpers/locales/index.ts b/client/src/app/helpers/locales/index.ts
new file mode 100644
index 000000000..b0e4d6148
--- /dev/null
+++ b/client/src/app/helpers/locales/index.ts
@@ -0,0 +1 @@
export * from './oc'
diff --git a/client/src/app/shared/locale/oc.ts b/client/src/app/helpers/locales/oc.ts
index d3b2e8407..d3b2e8407 100644
--- a/client/src/app/shared/locale/oc.ts
+++ b/client/src/app/helpers/locales/oc.ts
diff --git a/client/src/app/shared/misc/peertube-web-storage.ts b/client/src/app/helpers/peertube-web-storage.ts
index 0db1301bd..0db1301bd 100644
--- a/client/src/app/shared/misc/peertube-web-storage.ts
+++ b/client/src/app/helpers/peertube-web-storage.ts
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/helpers/utils.ts
index bc3ab85b3..879f697f4 100644
--- a/client/src/app/shared/misc/utils.ts
+++ b/client/src/app/helpers/utils.ts
@@ -1,6 +1,6 @@
1import { DatePipe } from '@angular/common' 1import { DatePipe } from '@angular/common'
2import { environment } from '../../../environments/environment' 2import { environment } from '../../environments/environment'
3import { AuthService } from '../../core/auth' 3import { AuthService } from '../core/auth'
4 4
5// Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript 5// Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
6function getParameterByName (name: string, url: string) { 6function getParameterByName (name: string, url: string) {
diff --git a/client/src/app/shared/rxjs/zone.ts b/client/src/app/helpers/zone.ts
index 74eed7032..74eed7032 100644
--- a/client/src/app/shared/rxjs/zone.ts
+++ b/client/src/app/helpers/zone.ts
diff --git a/client/src/app/login/login.component.ts b/client/src/app/login/login.component.ts
index fff4b43f6..cbc51ee21 100644
--- a/client/src/app/login/login.component.ts
+++ b/client/src/app/login/login.component.ts
@@ -1,16 +1,12 @@
1import { Component, ElementRef, OnInit, ViewChild, AfterViewInit } from '@angular/core'
2import { Notifier, RedirectService } from '@app/core'
3import { UserService } from '@app/shared'
4import { AuthService } from '../core'
5import { FormReactive } from '../shared'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
8import { LoginValidatorsService } from '@app/shared/forms/form-validators/login-validators.service'
9import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
10import { ActivatedRoute } from '@angular/router'
11import { ServerConfig, RegisteredExternalAuthConfig } from '@shared/models/server/server-config.model'
12import { environment } from 'src/environments/environment' 1import { environment } from 'src/environments/environment'
2import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core'
3import { ActivatedRoute } from '@angular/router'
4import { AuthService, Notifier, RedirectService, UserService } from '@app/core'
13import { HooksService } from '@app/core/plugins/hooks.service' 5import { HooksService } from '@app/core/plugins/hooks.service'
6import { FormReactive, FormValidatorService, LoginValidatorsService } from '@app/shared/shared-forms'
7import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { RegisteredExternalAuthConfig, ServerConfig } from '@shared/models'
14 10
15@Component({ 11@Component({
16 selector: 'my-login', 12 selector: 'my-login',
diff --git a/client/src/app/login/login.module.ts b/client/src/app/login/login.module.ts
index 1de72dbaa..c41902426 100644
--- a/client/src/app/login/login.module.ts
+++ b/client/src/app/login/login.module.ts
@@ -1,13 +1,17 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2 2import { SharedFormModule } from '@app/shared/shared-forms'
3import { SharedGlobalIconModule } from '@app/shared/shared-icons'
4import { SharedMainModule } from '@app/shared/shared-main'
3import { LoginRoutingModule } from './login-routing.module' 5import { LoginRoutingModule } from './login-routing.module'
4import { LoginComponent } from './login.component' 6import { LoginComponent } from './login.component'
5import { SharedModule } from '../shared'
6 7
7@NgModule({ 8@NgModule({
8 imports: [ 9 imports: [
9 LoginRoutingModule, 10 LoginRoutingModule,
10 SharedModule 11
12 SharedMainModule,
13 SharedFormModule,
14 SharedGlobalIconModule
11 ], 15 ],
12 16
13 declarations: [ 17 declarations: [
diff --git a/client/src/app/menu/avatar-notification.component.ts b/client/src/app/menu/avatar-notification.component.ts
index c447f031c..9a64faa6a 100644
--- a/client/src/app/menu/avatar-notification.component.ts
+++ b/client/src/app/menu/avatar-notification.component.ts
@@ -1,11 +1,10 @@
1import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
2import { User } from '../shared/users/user.model'
3import { UserNotificationService } from '@app/shared/users/user-notification.service'
4import { Subject, Subscription } from 'rxjs' 1import { Subject, Subscription } from 'rxjs'
5import { Notifier, UserNotificationSocket } from '@app/core'
6import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
7import { NavigationEnd, Router } from '@angular/router'
8import { filter } from 'rxjs/operators' 2import { filter } from 'rxjs/operators'
3import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
4import { NavigationEnd, Router } from '@angular/router'
5import { Notifier, User, UserNotificationSocket } from '@app/core'
6import { UserNotificationService } from '@app/shared/shared-main'
7import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
9 8
10@Component({ 9@Component({
11 selector: 'my-avatar-notification', 10 selector: 'my-avatar-notification',
diff --git a/client/src/app/menu/language-chooser.component.ts b/client/src/app/menu/language-chooser.component.ts
index c9b775921..3e89f72b8 100644
--- a/client/src/app/menu/language-chooser.component.ts
+++ b/client/src/app/menu/language-chooser.component.ts
@@ -1,9 +1,7 @@
1import { Component, ElementRef, ViewChild, Inject, LOCALE_ID } from '@angular/core' 1import { Component, ElementRef, Inject, LOCALE_ID, ViewChild } from '@angular/core'
2import { I18N_LOCALES, getShortLocale } from '../../../../shared' 2import { getDevLocale, isOnDevLocale, sortBy } from '@app/helpers'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { sortBy } from '@app/shared/misc/utils' 4import { getCompleteLocale, getShortLocale, I18N_LOCALES } from '@shared/models'
5import { getCompleteLocale } from '@shared/models/i18n'
6import { isOnDevLocale, getDevLocale } from '@app/shared/i18n/i18n-utils'
7 5
8@Component({ 6@Component({
9 selector: 'my-language-chooser', 7 selector: 'my-language-chooser',
diff --git a/client/src/app/menu/menu.component.ts b/client/src/app/menu/menu.component.ts
index ba3342541..2dbe695c9 100644
--- a/client/src/app/menu/menu.component.ts
+++ b/client/src/app/menu/menu.component.ts
@@ -1,14 +1,10 @@
1import { HotkeysService } from 'angular2-hotkeys'
1import { Component, OnInit, ViewChild } from '@angular/core' 2import { Component, OnInit, ViewChild } from '@angular/core'
2import { UserRight } from '../../../../shared/models/users/user-right.enum' 3import { AuthService, AuthStatus, RedirectService, ScreenService, ServerService, User, UserService } from '@app/core'
3import { AuthService, AuthStatus, RedirectService, ServerService } from '../core'
4import { User } from '@app/shared/users/user.model'
5import { UserService } from '@app/shared/users/user.service'
6import { LanguageChooserComponent } from '@app/menu/language-chooser.component' 4import { LanguageChooserComponent } from '@app/menu/language-chooser.component'
7import { HotkeysService } from 'angular2-hotkeys'
8import { ServerConfig, VideoConstant } from '@shared/models'
9import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component' 5import { QuickSettingsModalComponent } from '@app/modal/quick-settings-modal.component'
10import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
11import { ScreenService } from '@app/shared/misc/screen.service' 7import { ServerConfig, UserRight, VideoConstant } from '@shared/models'
12 8
13@Component({ 9@Component({
14 selector: 'my-menu', 10 selector: 'my-menu',
diff --git a/client/src/app/shared/confirm/confirm.component.html b/client/src/app/modal/confirm.component.html
index dbc8c23e3..dbc8c23e3 100644
--- a/client/src/app/shared/confirm/confirm.component.html
+++ b/client/src/app/modal/confirm.component.html
diff --git a/client/src/app/shared/confirm/confirm.component.scss b/client/src/app/modal/confirm.component.scss
index ed226bc09..ed226bc09 100644
--- a/client/src/app/shared/confirm/confirm.component.scss
+++ b/client/src/app/modal/confirm.component.scss
diff --git a/client/src/app/shared/confirm/confirm.component.ts b/client/src/app/modal/confirm.component.ts
index c6e40fe72..2c7ef46c4 100644
--- a/client/src/app/shared/confirm/confirm.component.ts
+++ b/client/src/app/modal/confirm.component.ts
@@ -1,9 +1,9 @@
1import { Component, ElementRef, HostListener, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'
2import { ConfirmService } from '@app/core/confirm/confirm.service' 2import { ConfirmService } from '@app/core/confirm/confirm.service'
3import { I18n } from '@ngx-translate/i18n-polyfill' 3import { POP_STATE_MODAL_DISMISS } from '@app/helpers'
4import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 4import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
5import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 5import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
6import { POP_STATE_MODAL_DISMISS } from '@app/shared/misc/constants' 6import { I18n } from '@ngx-translate/i18n-polyfill'
7 7
8@Component({ 8@Component({
9 selector: 'my-confirm', 9 selector: 'my-confirm',
diff --git a/client/src/app/modal/instance-config-warning-modal.component.ts b/client/src/app/modal/instance-config-warning-modal.component.ts
index 5e1433548..1c90f190a 100644
--- a/client/src/app/modal/instance-config-warning-modal.component.ts
+++ b/client/src/app/modal/instance-config-warning-modal.component.ts
@@ -1,8 +1,7 @@
1import { Component, ElementRef, ViewChild } from '@angular/core' 1import { Component, ElementRef, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier, UserService } from '@app/core'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { About } from '@shared/models/server' 4import { About } from '@shared/models/server'
5import { UserService } from '@app/shared'
6 5
7@Component({ 6@Component({
8 selector: 'my-instance-config-warning-modal', 7 selector: 'my-instance-config-warning-modal',
diff --git a/client/src/app/modal/quick-settings-modal.component.html b/client/src/app/modal/quick-settings-modal.component.html
index 188a51173..b95c14309 100644
--- a/client/src/app/modal/quick-settings-modal.component.html
+++ b/client/src/app/modal/quick-settings-modal.component.html
@@ -7,7 +7,7 @@
7 <div class="modal-body"> 7 <div class="modal-body">
8 <div i18n class="mb-4 quick-settings-title">Display settings</div> 8 <div i18n class="mb-4 quick-settings-title">Display settings</div>
9 9
10 <my-account-video-settings 10 <my-user-video-settings
11 *ngIf="!isUserLoggedIn()" 11 *ngIf="!isUserLoggedIn()"
12 [user]="user" [userInformationLoaded]="userInformationLoaded" [reactiveUpdate]="true" [notifyOnUpdate]="true" 12 [user]="user" [userInformationLoaded]="userInformationLoaded" [reactiveUpdate]="true" [notifyOnUpdate]="true"
13 > 13 >
@@ -15,13 +15,13 @@
15 <ng-container ngProjectAs="inner-title"> 15 <ng-container ngProjectAs="inner-title">
16 <div i18n class="mb-4 mt-4 quick-settings-title">Video settings</div> 16 <div i18n class="mb-4 mt-4 quick-settings-title">Video settings</div>
17 </ng-container> 17 </ng-container>
18 </my-account-video-settings> 18 </my-user-video-settings>
19 19
20 <div i18n class="mb-4 mt-4 quick-settings-title">Interface settings</div> 20 <div i18n class="mb-4 mt-4 quick-settings-title">Interface settings</div>
21 21
22 <my-account-interface-settings 22 <my-user-interface-settings
23 *ngIf="!isUserLoggedIn()" 23 *ngIf="!isUserLoggedIn()"
24 [user]="user" [userInformationLoaded]="userInformationLoaded" [reactiveUpdate]="true" [notifyOnUpdate]="true" 24 [user]="user" [userInformationLoaded]="userInformationLoaded" [reactiveUpdate]="true" [notifyOnUpdate]="true"
25 ></my-account-interface-settings> 25 ></my-user-interface-settings>
26 </div> 26 </div>
27</ng-template> 27</ng-template>
diff --git a/client/src/app/modal/quick-settings-modal.component.ts b/client/src/app/modal/quick-settings-modal.component.ts
index 155794d1b..95726ab63 100644
--- a/client/src/app/modal/quick-settings-modal.component.ts
+++ b/client/src/app/modal/quick-settings-modal.component.ts
@@ -1,11 +1,10 @@
1import { Component, ViewChild, OnInit } from '@angular/core'
2import { AuthService, AuthStatus } from '@app/core'
3import { FormReactive, FormValidatorService, UserService, User } from '@app/shared'
4import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
5import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
6import { ReplaySubject } from 'rxjs' 1import { ReplaySubject } from 'rxjs'
7import { LocalStorageService } from '@app/shared/misc/storage.service'
8import { filter } from 'rxjs/operators' 2import { filter } from 'rxjs/operators'
3import { Component, OnInit, ViewChild } from '@angular/core'
4import { AuthService, AuthStatus, LocalStorageService, User, UserService } from '@app/core'
5import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
6import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
7import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
9 8
10@Component({ 9@Component({
11 selector: 'my-quick-settings', 10 selector: 'my-quick-settings',
diff --git a/client/src/app/modal/welcome-modal.component.ts b/client/src/app/modal/welcome-modal.component.ts
index e022776e3..c2f289600 100644
--- a/client/src/app/modal/welcome-modal.component.ts
+++ b/client/src/app/modal/welcome-modal.component.ts
@@ -1,7 +1,6 @@
1import { Component, ElementRef, ViewChild } from '@angular/core' 1import { Component, ElementRef, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier, UserService } from '@app/core'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { UserService } from '@app/shared'
5 4
6@Component({ 5@Component({
7 selector: 'my-welcome-modal', 6 selector: 'my-welcome-modal',
diff --git a/client/src/app/reset-password/reset-password-routing.module.ts b/client/src/app/reset-password/reset-password-routing.module.ts
index b41069568..d443b51d6 100644
--- a/client/src/app/reset-password/reset-password-routing.module.ts
+++ b/client/src/app/reset-password/reset-password-routing.module.ts
@@ -1,8 +1,6 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3
4import { MetaGuard } from '@ngx-meta/core' 3import { MetaGuard } from '@ngx-meta/core'
5
6import { ResetPasswordComponent } from './reset-password.component' 4import { ResetPasswordComponent } from './reset-password.component'
7 5
8const resetPasswordRoutes: Routes = [ 6const resetPasswordRoutes: Routes = [
diff --git a/client/src/app/reset-password/reset-password.component.ts b/client/src/app/reset-password/reset-password.component.ts
index 07b93ee73..8d50e9839 100644
--- a/client/src/app/reset-password/reset-password.component.ts
+++ b/client/src/app/reset-password/reset-password.component.ts
@@ -1,10 +1,8 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { UserService, UserValidatorsService, FormReactive } from '@app/shared' 3import { Notifier, UserService } from '@app/core'
4import { Notifier } from '@app/core' 4import { FormReactive, FormValidatorService, ResetPasswordValidatorsService, UserValidatorsService } from '@app/shared/shared-forms'
5import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
7import { ResetPasswordValidatorsService } from '@app/shared/forms/form-validators/reset-password-validators.service'
8 6
9@Component({ 7@Component({
10 selector: 'my-login', 8 selector: 'my-login',
diff --git a/client/src/app/reset-password/reset-password.module.ts b/client/src/app/reset-password/reset-password.module.ts
index c2711981a..c77f1c4b0 100644
--- a/client/src/app/reset-password/reset-password.module.ts
+++ b/client/src/app/reset-password/reset-password.module.ts
@@ -1,13 +1,15 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2 2import { SharedFormModule } from '@app/shared/shared-forms'
3import { SharedMainModule } from '@app/shared/shared-main'
3import { ResetPasswordRoutingModule } from './reset-password-routing.module' 4import { ResetPasswordRoutingModule } from './reset-password-routing.module'
4import { ResetPasswordComponent } from './reset-password.component' 5import { ResetPasswordComponent } from './reset-password.component'
5import { SharedModule } from '../shared'
6 6
7@NgModule({ 7@NgModule({
8 imports: [ 8 imports: [
9 ResetPasswordRoutingModule, 9 ResetPasswordRoutingModule,
10 SharedModule 10
11 SharedMainModule,
12 SharedFormModule
11 ], 13 ],
12 14
13 declarations: [ 15 declarations: [
diff --git a/client/src/app/search/advanced-search.model.ts b/client/src/app/search/advanced-search.model.ts
index 643cc9a29..516854a8c 100644
--- a/client/src/app/search/advanced-search.model.ts
+++ b/client/src/app/search/advanced-search.model.ts
@@ -1,5 +1,4 @@
1import { SearchTargetType } from '@shared/models/search/search-target-query.model' 1import { NSFWQuery, SearchTargetType } from '@shared/models'
2import { NSFWQuery } from '../../../../shared/models/search'
3 2
4export class AdvancedSearch { 3export class AdvancedSearch {
5 startDate: string // ISO 8601 4 startDate: string // ISO 8601
diff --git a/client/src/app/shared/angular/highlight.pipe.ts b/client/src/app/search/highlight.pipe.ts
index 50ee5c1bd..50ee5c1bd 100644
--- a/client/src/app/shared/angular/highlight.pipe.ts
+++ b/client/src/app/search/highlight.pipe.ts
diff --git a/client/src/app/search/search-filters.component.ts b/client/src/app/search/search-filters.component.ts
index af76260a7..14a5d0484 100644
--- a/client/src/app/search/search-filters.component.ts
+++ b/client/src/app/search/search-filters.component.ts
@@ -1,10 +1,10 @@
1import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' 1import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
2import { ValidatorFn } from '@angular/forms' 2import { ValidatorFn } from '@angular/forms'
3import { VideoValidatorsService } from '@app/shared'
4import { ServerService } from '@app/core' 3import { ServerService } from '@app/core'
5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { AdvancedSearch } from '@app/search/advanced-search.model' 4import { AdvancedSearch } from '@app/search/advanced-search.model'
7import { ServerConfig, VideoConstant } from '../../../../shared' 5import { VideoValidatorsService } from '@app/shared/shared-forms'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { ServerConfig, VideoConstant } from '@shared/models'
8 8
9@Component({ 9@Component({
10 selector: 'my-search-filters', 10 selector: 'my-search-filters',
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts
index 6486085be..83b06e0ce 100644
--- a/client/src/app/search/search.component.ts
+++ b/client/src/app/search/search.component.ts
@@ -1,20 +1,15 @@
1import { forkJoin, of, Subscription } from 'rxjs' 1import { forkJoin, of, Subscription } from 'rxjs'
2import { Component, OnDestroy, OnInit } from '@angular/core' 2import { Component, OnDestroy, OnInit } from '@angular/core'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { AuthService, Notifier, ServerService } from '@app/core' 4import { AuthService, ComponentPagination, HooksService, Notifier, ServerService, User, UserService } from '@app/core'
5import { HooksService } from '@app/core/plugins/hooks.service' 5import { immutableAssign } from '@app/helpers'
6import { AdvancedSearch } from '@app/search/advanced-search.model' 6import { Video, VideoChannel } from '@app/shared/shared-main'
7import { SearchService } from '@app/search/search.service' 7import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature'
8import { User, UserService } from '@app/shared'
9import { immutableAssign } from '@app/shared/misc/utils'
10import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
11import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
12import { MiniatureDisplayOptions } from '@app/shared/video/video-miniature.component'
13import { Video } from '@app/shared/video/video.model'
14import { MetaService } from '@ngx-meta/core' 8import { MetaService } from '@ngx-meta/core'
15import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
16import { ServerConfig } from '@shared/models' 10import { SearchTargetType, ServerConfig } from '@shared/models'
17import { SearchTargetType } from '@shared/models/search/search-target-query.model' 11import { AdvancedSearch } from './advanced-search.model'
12import { SearchService } from './search.service'
18 13
19@Component({ 14@Component({
20 selector: 'my-search', 15 selector: 'my-search',
diff --git a/client/src/app/search/search.module.ts b/client/src/app/search/search.module.ts
index df5459802..65c954de8 100644
--- a/client/src/app/search/search.module.ts
+++ b/client/src/app/search/search.module.ts
@@ -1,11 +1,15 @@
1import { TagInputModule } from 'ngx-chips' 1import { TagInputModule } from 'ngx-chips'
2import { NgModule } from '@angular/core' 2import { NgModule } from '@angular/core'
3import { SearchFiltersComponent } from '@app/search/search-filters.component' 3import { SharedFormModule } from '@app/shared/shared-forms'
4import { SearchRoutingModule } from '@app/search/search-routing.module' 4import { SharedMainModule } from '@app/shared/shared-main'
5import { SearchComponent } from '@app/search/search.component' 5import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription'
6import { SearchService } from '@app/search/search.service' 6import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
7import { SharedModule } from '../shared'
8import { ChannelLazyLoadResolver } from './channel-lazy-load.resolver' 7import { ChannelLazyLoadResolver } from './channel-lazy-load.resolver'
8import { HighlightPipe } from './highlight.pipe'
9import { SearchFiltersComponent } from './search-filters.component'
10import { SearchRoutingModule } from './search-routing.module'
11import { SearchComponent } from './search.component'
12import { SearchService } from './search.service'
9import { VideoLazyLoadResolver } from './video-lazy-load.resolver' 13import { VideoLazyLoadResolver } from './video-lazy-load.resolver'
10 14
11@NgModule({ 15@NgModule({
@@ -13,7 +17,10 @@ import { VideoLazyLoadResolver } from './video-lazy-load.resolver'
13 TagInputModule, 17 TagInputModule,
14 18
15 SearchRoutingModule, 19 SearchRoutingModule,
16 SharedModule 20 SharedMainModule,
21 SharedFormModule,
22 SharedUserSubscriptionModule,
23 SharedVideoMiniatureModule
17 ], 24 ],
18 25
19 declarations: [ 26 declarations: [
@@ -29,7 +36,8 @@ import { VideoLazyLoadResolver } from './video-lazy-load.resolver'
29 providers: [ 36 providers: [
30 SearchService, 37 SearchService,
31 VideoLazyLoadResolver, 38 VideoLazyLoadResolver,
32 ChannelLazyLoadResolver 39 ChannelLazyLoadResolver,
40 HighlightPipe
33 ] 41 ]
34}) 42})
35export class SearchModule { } 43export class SearchModule { }
diff --git a/client/src/app/search/search.service.ts b/client/src/app/search/search.service.ts
index fdb12ea2c..36342034f 100644
--- a/client/src/app/search/search.service.ts
+++ b/client/src/app/search/search.service.ts
@@ -2,17 +2,13 @@ import { Observable } from 'rxjs'
2import { catchError, map, switchMap } from 'rxjs/operators' 2import { catchError, map, switchMap } from 'rxjs/operators'
3import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
4import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
5import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core'
6import { peertubeLocalStorage } from '@app/helpers'
5import { AdvancedSearch } from '@app/search/advanced-search.model' 7import { AdvancedSearch } from '@app/search/advanced-search.model'
6import { RestExtractor, RestPagination, RestService } from '@app/shared' 8import { Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
7import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' 9import { ResultList, Video as VideoServerModel, VideoChannel as VideoChannelServerModel } from '@shared/models'
8import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model'
9import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
10import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
11import { Video } from '@app/shared/video/video.model'
12import { VideoService } from '@app/shared/video/video.service'
13import { ResultList, Video as VideoServerModel, VideoChannel as VideoChannelServerModel } from '../../../../shared'
14import { environment } from '../../environments/environment'
15import { SearchTargetType } from '@shared/models/search/search-target-query.model' 10import { SearchTargetType } from '@shared/models/search/search-target-query.model'
11import { environment } from '../../environments/environment'
16 12
17@Injectable() 13@Injectable()
18export class SearchService { 14export class SearchService {
diff --git a/client/src/app/shared/angular/object-length.pipe.ts b/client/src/app/shared/angular/object-length.pipe.ts
deleted file mode 100644
index 84d182052..000000000
--- a/client/src/app/shared/angular/object-length.pipe.ts
+++ /dev/null
@@ -1,8 +0,0 @@
1import { Pipe, PipeTransform } from '@angular/core'
2
3@Pipe({ name: 'myObjectLength' })
4export class ObjectLengthPipe implements PipeTransform {
5 transform (value: Object) {
6 return Object.keys(value).length
7 }
8}
diff --git a/client/src/app/shared/blocklist/index.ts b/client/src/app/shared/blocklist/index.ts
deleted file mode 100644
index 188057b19..000000000
--- a/client/src/app/shared/blocklist/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export * from './blocklist.service'
2export * from './account-block.model'
3export * from './server-blocklist.component'
4export * from './account-blocklist.component'
diff --git a/client/src/app/shared/forms/index.ts b/client/src/app/shared/forms/index.ts
deleted file mode 100644
index 8febbfee9..000000000
--- a/client/src/app/shared/forms/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export * from './form-validators'
2export * from './form-reactive'
3export * from './reactive-file.component'
4export * from './textarea-autoresize.directive'
diff --git a/client/src/app/shared/index.ts b/client/src/app/shared/index.ts
deleted file mode 100644
index 8be578d9f..000000000
--- a/client/src/app/shared/index.ts
+++ /dev/null
@@ -1,7 +0,0 @@
1export * from './auth'
2export * from './forms'
3export * from './rest'
4export * from './users'
5export * from './video-abuse'
6export * from './video-block'
7export * from './shared.module'
diff --git a/client/src/app/shared/moderation/index.ts b/client/src/app/shared/moderation/index.ts
deleted file mode 100644
index 9a77c64c0..000000000
--- a/client/src/app/shared/moderation/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export * from './user-ban-modal.component'
2export * from './user-moderation-dropdown.component'
diff --git a/client/src/app/shared/overview/index.ts b/client/src/app/shared/overview/index.ts
deleted file mode 100644
index 2f7e41298..000000000
--- a/client/src/app/shared/overview/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './overview.service'
diff --git a/client/src/app/shared/forms/form-reactive.ts b/client/src/app/shared/shared-forms/form-reactive.ts
index 6aec2937d..caa31d831 100644
--- a/client/src/app/shared/forms/form-reactive.ts
+++ b/client/src/app/shared/shared-forms/form-reactive.ts
@@ -1,5 +1,5 @@
1import { FormGroup } from '@angular/forms' 1import { FormGroup } from '@angular/forms'
2import { BuildFormArgument, BuildFormDefaultValues, FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 2import { BuildFormArgument, BuildFormDefaultValues, FormValidatorService } from './form-validators'
3 3
4export type FormReactiveErrors = { [ id: string ]: string | FormReactiveErrors } 4export type FormReactiveErrors = { [ id: string ]: string | FormReactiveErrors }
5export type FormReactiveValidationMessages = { 5export type FormReactiveValidationMessages = {
diff --git a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/batch-domains-validators.service.ts
index 46fa6514d..f270b602b 100644
--- a/client/src/app/+admin/config/shared/batch-domains-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/batch-domains-validators.service.ts
@@ -1,7 +1,8 @@
1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators, ValidatorFn } from '@angular/forms'
3import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
4import { BuildFormValidator, validateHost } from '@app/shared/forms/form-validators' 2import { ValidatorFn, Validators } from '@angular/forms'
3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { BuildFormValidator } from './form-validator.service'
5import { validateHost } from './host'
5 6
6@Injectable() 7@Injectable()
7export class BatchDomainsValidatorsService { 8export class BatchDomainsValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/custom-config-validators.service.ts
index fdb19e06a..c77aba6a1 100644
--- a/client/src/app/shared/forms/form-validators/custom-config-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/custom-config-validators.service.ts
@@ -1,6 +1,6 @@
1import { Validators } from '@angular/forms' 1import { Validators } from '@angular/forms'
2import { I18n } from '@ngx-translate/i18n-polyfill' 2import { I18n } from '@ngx-translate/i18n-polyfill'
3import { BuildFormValidator } from '@app/shared' 3import { BuildFormValidator } from './form-validator.service'
4import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
5 5
6@Injectable() 6@Injectable()
diff --git a/client/src/app/shared/forms/form-validators/form-validator.service.ts b/client/src/app/shared/shared-forms/form-validators/form-validator.service.ts
index 249fdf119..dec7d8d9a 100644
--- a/client/src/app/shared/forms/form-validators/form-validator.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/form-validator.service.ts
@@ -1,6 +1,6 @@
1import { FormBuilder, FormControl, FormGroup, ValidatorFn } from '@angular/forms' 1import { FormBuilder, FormControl, FormGroup, ValidatorFn } from '@angular/forms'
2import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
3import { FormReactiveErrors, FormReactiveValidationMessages } from '@app/shared/forms/form-reactive' 3import { FormReactiveErrors, FormReactiveValidationMessages } from '../form-reactive'
4 4
5export type BuildFormValidator = { 5export type BuildFormValidator = {
6 VALIDATORS: ValidatorFn[], 6 VALIDATORS: ValidatorFn[],
diff --git a/client/src/app/shared/forms/form-validators/host.ts b/client/src/app/shared/shared-forms/form-validators/host.ts
index c18a35f9b..c18a35f9b 100644
--- a/client/src/app/shared/forms/form-validators/host.ts
+++ b/client/src/app/shared/shared-forms/form-validators/host.ts
diff --git a/client/src/app/shared/forms/form-validators/index.ts b/client/src/app/shared/shared-forms/form-validators/index.ts
index 4a01b1622..8b71841a9 100644
--- a/client/src/app/shared/forms/form-validators/index.ts
+++ b/client/src/app/shared/shared-forms/form-validators/index.ts
@@ -1,3 +1,4 @@
1export * from './batch-domains-validators.service'
1export * from './custom-config-validators.service' 2export * from './custom-config-validators.service'
2export * from './form-validator.service' 3export * from './form-validator.service'
3export * from './host' 4export * from './host'
@@ -6,11 +7,11 @@ export * from './login-validators.service'
6export * from './reset-password-validators.service' 7export * from './reset-password-validators.service'
7export * from './user-validators.service' 8export * from './user-validators.service'
8export * from './video-abuse-validators.service' 9export * from './video-abuse-validators.service'
10export * from './video-accept-ownership-validators.service'
9export * from './video-block-validators.service' 11export * from './video-block-validators.service'
12export * from './video-captions-validators.service'
13export * from './video-change-ownership-validators.service'
10export * from './video-channel-validators.service' 14export * from './video-channel-validators.service'
11export * from './video-comment-validators.service' 15export * from './video-comment-validators.service'
12export * from './video-validators.service'
13export * from './video-playlist-validators.service' 16export * from './video-playlist-validators.service'
14export * from './video-captions-validators.service' 17export * from './video-validators.service'
15export * from './video-change-ownership-validators.service'
16export * from './video-accept-ownership-validators.service'
diff --git a/client/src/app/shared/forms/form-validators/instance-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts
index cc5f3c5a1..96a35a48f 100644
--- a/client/src/app/shared/forms/form-validators/instance-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/instance-validators.service.ts
@@ -1,6 +1,6 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { BuildFormValidator } from '@app/shared' 3import { BuildFormValidator } from './form-validator.service'
4import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
5 5
6@Injectable() 6@Injectable()
diff --git a/client/src/app/shared/forms/form-validators/login-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts
index 9d68f830c..a5837357e 100644
--- a/client/src/app/shared/forms/form-validators/login-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/login-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class LoginValidatorsService { 7export class LoginValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/reset-password-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/reset-password-validators.service.ts
index df206254d..d2085a309 100644
--- a/client/src/app/shared/forms/form-validators/reset-password-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/reset-password-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class ResetPasswordValidatorsService { 7export class ResetPasswordValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/user-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/user-validators.service.ts
index 13b9228d4..bd3030a54 100644
--- a/client/src/app/shared/forms/form-validators/user-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/user-validators.service.ts
@@ -1,6 +1,6 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { BuildFormValidator } from '@app/shared' 3import { BuildFormValidator } from './form-validator.service'
4import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
5 5
6@Injectable() 6@Injectable()
diff --git a/client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-abuse-validators.service.ts
index fcc966b84..aae56d607 100644
--- a/client/src/app/shared/forms/form-validators/video-abuse-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/video-abuse-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class VideoAbuseValidatorsService { 7export class VideoAbuseValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/video-accept-ownership-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-accept-ownership-validators.service.ts
index 48c7054a4..998d616ec 100644
--- a/client/src/app/shared/forms/form-validators/video-accept-ownership-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/video-accept-ownership-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class VideoAcceptOwnershipValidatorsService { 7export class VideoAcceptOwnershipValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/video-block-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts
index dc8257761..ddf0ab5eb 100644
--- a/client/src/app/shared/forms/form-validators/video-block-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/video-block-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class VideoBlockValidatorsService { 7export class VideoBlockValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/video-captions-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-captions-validators.service.ts
index d1b4667bb..280d28414 100644
--- a/client/src/app/shared/forms/form-validators/video-captions-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/video-captions-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class VideoCaptionsValidatorsService { 7export class VideoCaptionsValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/video-change-ownership-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts
index c6fbb7538..59659defd 100644
--- a/client/src/app/shared/forms/form-validators/video-change-ownership-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/video-change-ownership-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { AbstractControl, ValidationErrors, Validators } from '@angular/forms' 2import { AbstractControl, ValidationErrors, Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class VideoChangeOwnershipValidatorsService { 7export class VideoChangeOwnershipValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/video-channel-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts
index 1c519c10a..bb650b149 100644
--- a/client/src/app/shared/forms/form-validators/video-channel-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/video-channel-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class VideoChannelValidatorsService { 7export class VideoChannelValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/video-comment-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-comment-validators.service.ts
index 45c7081ef..97c8e967e 100644
--- a/client/src/app/shared/forms/form-validators/video-comment-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/video-comment-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class VideoCommentValidatorsService { 7export class VideoCommentValidatorsService {
diff --git a/client/src/app/shared/forms/form-validators/video-playlist-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts
index a2c9a5368..ab9c43625 100644
--- a/client/src/app/shared/forms/form-validators/video-playlist-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/video-playlist-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { AbstractControl, FormControl, Validators } from '@angular/forms' 2import { AbstractControl, FormControl, Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5import { VideoPlaylistPrivacy } from '@shared/models' 5import { VideoPlaylistPrivacy } from '@shared/models'
6 6
7@Injectable() 7@Injectable()
diff --git a/client/src/app/shared/forms/form-validators/video-validators.service.ts b/client/src/app/shared/shared-forms/form-validators/video-validators.service.ts
index e3f7a0969..9b24e4f62 100644
--- a/client/src/app/shared/forms/form-validators/video-validators.service.ts
+++ b/client/src/app/shared/shared-forms/form-validators/video-validators.service.ts
@@ -1,7 +1,7 @@
1import { I18n } from '@ngx-translate/i18n-polyfill' 1import { I18n } from '@ngx-translate/i18n-polyfill'
2import { Validators } from '@angular/forms' 2import { Validators } from '@angular/forms'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { BuildFormValidator } from '@app/shared' 4import { BuildFormValidator } from './form-validator.service'
5 5
6@Injectable() 6@Injectable()
7export class VideoValidatorsService { 7export class VideoValidatorsService {
diff --git a/client/src/app/shared/shared-forms/index.ts b/client/src/app/shared/shared-forms/index.ts
new file mode 100644
index 000000000..aa0ee015a
--- /dev/null
+++ b/client/src/app/shared/shared-forms/index.ts
@@ -0,0 +1,10 @@
1export * from './form-validators'
2export * from './form-reactive'
3export * from './input-readonly-copy.component'
4export * from './markdown-textarea.component'
5export * from './peertube-checkbox.component'
6export * from './preview-upload.component'
7export * from './reactive-file.component'
8export * from './textarea-autoresize.directive'
9export * from './timestamp-input.component'
10export * from './shared-form.module'
diff --git a/client/src/app/shared/forms/input-readonly-copy.component.html b/client/src/app/shared/shared-forms/input-readonly-copy.component.html
index 9566e9741..9566e9741 100644
--- a/client/src/app/shared/forms/input-readonly-copy.component.html
+++ b/client/src/app/shared/shared-forms/input-readonly-copy.component.html
diff --git a/client/src/app/shared/forms/input-readonly-copy.component.scss b/client/src/app/shared/shared-forms/input-readonly-copy.component.scss
index 8dc4f113c..8dc4f113c 100644
--- a/client/src/app/shared/forms/input-readonly-copy.component.scss
+++ b/client/src/app/shared/shared-forms/input-readonly-copy.component.scss
diff --git a/client/src/app/shared/forms/input-readonly-copy.component.ts b/client/src/app/shared/shared-forms/input-readonly-copy.component.ts
index 7528fb7a1..7528fb7a1 100644
--- a/client/src/app/shared/forms/input-readonly-copy.component.ts
+++ b/client/src/app/shared/shared-forms/input-readonly-copy.component.ts
diff --git a/client/src/app/shared/forms/markdown-textarea.component.html b/client/src/app/shared/shared-forms/markdown-textarea.component.html
index a519f3e0a..a519f3e0a 100644
--- a/client/src/app/shared/forms/markdown-textarea.component.html
+++ b/client/src/app/shared/shared-forms/markdown-textarea.component.html
diff --git a/client/src/app/shared/forms/markdown-textarea.component.scss b/client/src/app/shared/shared-forms/markdown-textarea.component.scss
index f2c76f7a1..f2c76f7a1 100644
--- a/client/src/app/shared/forms/markdown-textarea.component.scss
+++ b/client/src/app/shared/shared-forms/markdown-textarea.component.scss
diff --git a/client/src/app/shared/forms/markdown-textarea.component.ts b/client/src/app/shared/shared-forms/markdown-textarea.component.ts
index dde7b4d98..8dad5314c 100644
--- a/client/src/app/shared/forms/markdown-textarea.component.ts
+++ b/client/src/app/shared/shared-forms/markdown-textarea.component.ts
@@ -1,10 +1,9 @@
1import truncate from 'lodash-es/truncate'
2import { Subject } from 'rxjs'
1import { debounceTime, distinctUntilChanged } from 'rxjs/operators' 3import { debounceTime, distinctUntilChanged } from 'rxjs/operators'
2import { Component, forwardRef, Input, OnInit, ViewChild, ElementRef } from '@angular/core' 4import { Component, ElementRef, forwardRef, Input, OnInit, ViewChild } from '@angular/core'
3import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' 5import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
4import { Subject } from 'rxjs' 6import { MarkdownService } from '@app/core'
5import truncate from 'lodash-es/truncate'
6import { ScreenService } from '@app/shared/misc/screen.service'
7import { MarkdownService } from '@app/shared/renderer'
8 7
9@Component({ 8@Component({
10 selector: 'my-markdown-textarea', 9 selector: 'my-markdown-textarea',
@@ -37,10 +36,7 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
37 36
38 private contentChanged = new Subject<string>() 37 private contentChanged = new Subject<string>()
39 38
40 constructor ( 39 constructor (private markdownService: MarkdownService) {}
41 private screenService: ScreenService,
42 private markdownService: MarkdownService
43) {}
44 40
45 ngOnInit () { 41 ngOnInit () {
46 this.contentChanged 42 this.contentChanged
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.html b/client/src/app/shared/shared-forms/peertube-checkbox.component.html
index 704f3e696..704f3e696 100644
--- a/client/src/app/shared/forms/peertube-checkbox.component.html
+++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.html
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.scss b/client/src/app/shared/shared-forms/peertube-checkbox.component.scss
index cf8540dc3..cf8540dc3 100644
--- a/client/src/app/shared/forms/peertube-checkbox.component.scss
+++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.scss
diff --git a/client/src/app/shared/forms/peertube-checkbox.component.ts b/client/src/app/shared/shared-forms/peertube-checkbox.component.ts
index 89e79fecd..76ef77e5a 100644
--- a/client/src/app/shared/forms/peertube-checkbox.component.ts
+++ b/client/src/app/shared/shared-forms/peertube-checkbox.component.ts
@@ -1,6 +1,6 @@
1import { AfterContentInit, ChangeDetectorRef, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core' 1import { AfterContentInit, ChangeDetectorRef, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core'
2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' 2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
3import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive' 3import { PeerTubeTemplateDirective } from '@app/shared/shared-main'
4 4
5@Component({ 5@Component({
6 selector: 'my-peertube-checkbox', 6 selector: 'my-peertube-checkbox',
diff --git a/client/src/app/shared/images/preview-upload.component.html b/client/src/app/shared/shared-forms/preview-upload.component.html
index 7c3a2b588..7c3a2b588 100644
--- a/client/src/app/shared/images/preview-upload.component.html
+++ b/client/src/app/shared/shared-forms/preview-upload.component.html
diff --git a/client/src/app/shared/images/preview-upload.component.scss b/client/src/app/shared/shared-forms/preview-upload.component.scss
index 88eccd5f7..88eccd5f7 100644
--- a/client/src/app/shared/images/preview-upload.component.scss
+++ b/client/src/app/shared/shared-forms/preview-upload.component.scss
diff --git a/client/src/app/shared/images/preview-upload.component.ts b/client/src/app/shared/shared-forms/preview-upload.component.ts
index 7519734ba..7519734ba 100644
--- a/client/src/app/shared/images/preview-upload.component.ts
+++ b/client/src/app/shared/shared-forms/preview-upload.component.ts
diff --git a/client/src/app/shared/forms/reactive-file.component.html b/client/src/app/shared/shared-forms/reactive-file.component.html
index f6bf5f9ae..f6bf5f9ae 100644
--- a/client/src/app/shared/forms/reactive-file.component.html
+++ b/client/src/app/shared/shared-forms/reactive-file.component.html
diff --git a/client/src/app/shared/forms/reactive-file.component.scss b/client/src/app/shared/shared-forms/reactive-file.component.scss
index 84c23c1d6..84c23c1d6 100644
--- a/client/src/app/shared/forms/reactive-file.component.scss
+++ b/client/src/app/shared/shared-forms/reactive-file.component.scss
diff --git a/client/src/app/shared/forms/reactive-file.component.ts b/client/src/app/shared/shared-forms/reactive-file.component.ts
index b7a821d4f..9ebf487ce 100644
--- a/client/src/app/shared/forms/reactive-file.component.ts
+++ b/client/src/app/shared/shared-forms/reactive-file.component.ts
@@ -1,8 +1,8 @@
1import { Component, EventEmitter, forwardRef, Input, OnInit, Output } from '@angular/core' 1import { Component, EventEmitter, forwardRef, Input, OnInit, Output } from '@angular/core'
2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' 2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
3import { Notifier } from '@app/core' 3import { Notifier } from '@app/core'
4import { GlobalIconName } from '@app/shared/shared-icons'
4import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
5import { GlobalIconName } from '@app/shared/images/global-icon.component'
6 6
7@Component({ 7@Component({
8 selector: 'my-reactive-file', 8 selector: 'my-reactive-file',
diff --git a/client/src/app/shared/shared-forms/shared-form.module.ts b/client/src/app/shared/shared-forms/shared-form.module.ts
new file mode 100644
index 000000000..e82fa97d4
--- /dev/null
+++ b/client/src/app/shared/shared-forms/shared-form.module.ts
@@ -0,0 +1,84 @@
1
2import { NgModule } from '@angular/core'
3import { FormsModule, ReactiveFormsModule } from '@angular/forms'
4import { BatchDomainsValidatorsService } from '@app/shared/shared-forms/form-validators/batch-domains-validators.service'
5import { SharedGlobalIconModule } from '../shared-icons'
6import { SharedMainModule } from '../shared-main/shared-main.module'
7import {
8 CustomConfigValidatorsService,
9 FormValidatorService,
10 InstanceValidatorsService,
11 LoginValidatorsService,
12 ResetPasswordValidatorsService,
13 UserValidatorsService,
14 VideoAbuseValidatorsService,
15 VideoAcceptOwnershipValidatorsService,
16 VideoBlockValidatorsService,
17 VideoCaptionsValidatorsService,
18 VideoChangeOwnershipValidatorsService,
19 VideoChannelValidatorsService,
20 VideoCommentValidatorsService,
21 VideoPlaylistValidatorsService,
22 VideoValidatorsService
23} from './form-validators'
24import { InputReadonlyCopyComponent } from './input-readonly-copy.component'
25import { MarkdownTextareaComponent } from './markdown-textarea.component'
26import { PeertubeCheckboxComponent } from './peertube-checkbox.component'
27import { PreviewUploadComponent } from './preview-upload.component'
28import { ReactiveFileComponent } from './reactive-file.component'
29import { TextareaAutoResizeDirective } from './textarea-autoresize.directive'
30import { TimestampInputComponent } from './timestamp-input.component'
31
32@NgModule({
33 imports: [
34 FormsModule,
35 ReactiveFormsModule,
36
37 SharedMainModule,
38 SharedGlobalIconModule
39 ],
40
41 declarations: [
42 InputReadonlyCopyComponent,
43 MarkdownTextareaComponent,
44 PeertubeCheckboxComponent,
45 PreviewUploadComponent,
46 ReactiveFileComponent,
47 TextareaAutoResizeDirective,
48 TimestampInputComponent
49 ],
50
51 exports: [
52 FormsModule,
53 ReactiveFormsModule,
54
55 InputReadonlyCopyComponent,
56 MarkdownTextareaComponent,
57 PeertubeCheckboxComponent,
58 PreviewUploadComponent,
59 ReactiveFileComponent,
60 TextareaAutoResizeDirective,
61 TimestampInputComponent
62 ],
63
64 providers: [
65 CustomConfigValidatorsService,
66 FormValidatorService,
67 LoginValidatorsService,
68 InstanceValidatorsService,
69 LoginValidatorsService,
70 ResetPasswordValidatorsService,
71 UserValidatorsService,
72 VideoAbuseValidatorsService,
73 VideoAcceptOwnershipValidatorsService,
74 VideoBlockValidatorsService,
75 VideoCaptionsValidatorsService,
76 VideoChangeOwnershipValidatorsService,
77 VideoChannelValidatorsService,
78 VideoCommentValidatorsService,
79 VideoPlaylistValidatorsService,
80 VideoValidatorsService,
81 BatchDomainsValidatorsService
82 ]
83})
84export class SharedFormModule { }
diff --git a/client/src/app/shared/forms/textarea-autoresize.directive.ts b/client/src/app/shared/shared-forms/textarea-autoresize.directive.ts
index f8c855c16..f8c855c16 100644
--- a/client/src/app/shared/forms/textarea-autoresize.directive.ts
+++ b/client/src/app/shared/shared-forms/textarea-autoresize.directive.ts
diff --git a/client/src/app/shared/forms/timestamp-input.component.html b/client/src/app/shared/shared-forms/timestamp-input.component.html
index c57a4b32c..c57a4b32c 100644
--- a/client/src/app/shared/forms/timestamp-input.component.html
+++ b/client/src/app/shared/shared-forms/timestamp-input.component.html
diff --git a/client/src/app/shared/forms/timestamp-input.component.scss b/client/src/app/shared/shared-forms/timestamp-input.component.scss
index 8092b095b..8092b095b 100644
--- a/client/src/app/shared/forms/timestamp-input.component.scss
+++ b/client/src/app/shared/shared-forms/timestamp-input.component.scss
diff --git a/client/src/app/shared/forms/timestamp-input.component.ts b/client/src/app/shared/shared-forms/timestamp-input.component.ts
index 8d67a96ac..8d67a96ac 100644
--- a/client/src/app/shared/forms/timestamp-input.component.ts
+++ b/client/src/app/shared/shared-forms/timestamp-input.component.ts
diff --git a/client/src/app/shared/images/global-icon.component.scss b/client/src/app/shared/shared-icons/global-icon.component.scss
index 6795d6628..6795d6628 100644
--- a/client/src/app/shared/images/global-icon.component.scss
+++ b/client/src/app/shared/shared-icons/global-icon.component.scss
diff --git a/client/src/app/shared/images/global-icon.component.ts b/client/src/app/shared/shared-icons/global-icon.component.ts
index 169882685..169882685 100644
--- a/client/src/app/shared/images/global-icon.component.ts
+++ b/client/src/app/shared/shared-icons/global-icon.component.ts
diff --git a/client/src/app/shared/shared-icons/index.ts b/client/src/app/shared/shared-icons/index.ts
new file mode 100644
index 000000000..478e5c97d
--- /dev/null
+++ b/client/src/app/shared/shared-icons/index.ts
@@ -0,0 +1,3 @@
1export * from './global-icon.component'
2
3export * from './shared-global-icon.module'
diff --git a/client/src/app/shared/shared-icons/shared-global-icon.module.ts b/client/src/app/shared/shared-icons/shared-global-icon.module.ts
new file mode 100644
index 000000000..b3020c78d
--- /dev/null
+++ b/client/src/app/shared/shared-icons/shared-global-icon.module.ts
@@ -0,0 +1,21 @@
1
2import { CommonModule } from '@angular/common'
3import { NgModule } from '@angular/core'
4import { GlobalIconComponent } from './global-icon.component'
5
6@NgModule({
7 imports: [
8 CommonModule
9 ],
10
11 declarations: [
12 GlobalIconComponent
13 ],
14
15 exports: [
16 GlobalIconComponent
17 ],
18
19 providers: [ ]
20})
21export class SharedGlobalIconModule { }
diff --git a/client/src/app/shared/instance/feature-boolean.component.html b/client/src/app/shared/shared-instance/feature-boolean.component.html
index ccb8a30cc..ccb8a30cc 100644
--- a/client/src/app/shared/instance/feature-boolean.component.html
+++ b/client/src/app/shared/shared-instance/feature-boolean.component.html
diff --git a/client/src/app/shared/instance/feature-boolean.component.scss b/client/src/app/shared/shared-instance/feature-boolean.component.scss
index 56d08af06..56d08af06 100644
--- a/client/src/app/shared/instance/feature-boolean.component.scss
+++ b/client/src/app/shared/shared-instance/feature-boolean.component.scss
diff --git a/client/src/app/shared/instance/feature-boolean.component.ts b/client/src/app/shared/shared-instance/feature-boolean.component.ts
index d02d513d6..d02d513d6 100644
--- a/client/src/app/shared/instance/feature-boolean.component.ts
+++ b/client/src/app/shared/shared-instance/feature-boolean.component.ts
diff --git a/client/src/app/shared/shared-instance/index.ts b/client/src/app/shared/shared-instance/index.ts
new file mode 100644
index 000000000..1aeed357e
--- /dev/null
+++ b/client/src/app/shared/shared-instance/index.ts
@@ -0,0 +1,6 @@
1export * from './feature-boolean.component'
2export * from './instance-features-table.component'
3export * from './instance-follow.service'
4export * from './instance-statistics.component'
5export * from './instance.service'
6export * from './shared-instance.module'
diff --git a/client/src/app/shared/instance/instance-features-table.component.html b/client/src/app/shared/shared-instance/instance-features-table.component.html
index f6a3b7f0b..f6a3b7f0b 100644
--- a/client/src/app/shared/instance/instance-features-table.component.html
+++ b/client/src/app/shared/shared-instance/instance-features-table.component.html
diff --git a/client/src/app/shared/instance/instance-features-table.component.scss b/client/src/app/shared/shared-instance/instance-features-table.component.scss
index a51574741..a51574741 100644
--- a/client/src/app/shared/instance/instance-features-table.component.scss
+++ b/client/src/app/shared/shared-instance/instance-features-table.component.scss
diff --git a/client/src/app/shared/instance/instance-features-table.component.ts b/client/src/app/shared/shared-instance/instance-features-table.component.ts
index 8fd15ebad..8fd15ebad 100644
--- a/client/src/app/shared/instance/instance-features-table.component.ts
+++ b/client/src/app/shared/shared-instance/instance-features-table.component.ts
diff --git a/client/src/app/shared/instance/follow.service.ts b/client/src/app/shared/shared-instance/instance-follow.service.ts
index ef4c09583..3c9ccc40f 100644
--- a/client/src/app/shared/instance/follow.service.ts
+++ b/client/src/app/shared/shared-instance/instance-follow.service.ts
@@ -1,14 +1,14 @@
1import { SortMeta } from 'primeng/api'
2import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 3import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
4import { Observable } from 'rxjs' 6import { RestExtractor, RestPagination, RestService } from '@app/core'
5import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/index' 7import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/index'
6import { environment } from '../../../environments/environment' 8import { environment } from '../../../environments/environment'
7import { RestExtractor, RestPagination, RestService } from '../rest'
8import { SortMeta } from 'primeng/api'
9 9
10@Injectable() 10@Injectable()
11export class FollowService { 11export class InstanceFollowService {
12 private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/server' 12 private static BASE_APPLICATION_URL = environment.apiUrl + '/api/v1/server'
13 13
14 constructor ( 14 constructor (
@@ -34,7 +34,7 @@ export class FollowService {
34 if (state) params = params.append('state', state) 34 if (state) params = params.append('state', state)
35 if (actorType) params = params.append('actorType', actorType) 35 if (actorType) params = params.append('actorType', actorType)
36 36
37 return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/following', { params }) 37 return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/following', { params })
38 .pipe( 38 .pipe(
39 map(res => this.restExtractor.convertResultListDateToHuman(res)), 39 map(res => this.restExtractor.convertResultListDateToHuman(res)),
40 catchError(res => this.restExtractor.handleError(res)) 40 catchError(res => this.restExtractor.handleError(res))
@@ -57,7 +57,7 @@ export class FollowService {
57 if (state) params = params.append('state', state) 57 if (state) params = params.append('state', state)
58 if (actorType) params = params.append('actorType', actorType) 58 if (actorType) params = params.append('actorType', actorType)
59 59
60 return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/followers', { params }) 60 return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/followers', { params })
61 .pipe( 61 .pipe(
62 map(res => this.restExtractor.convertResultListDateToHuman(res)), 62 map(res => this.restExtractor.convertResultListDateToHuman(res)),
63 catchError(res => this.restExtractor.handleError(res)) 63 catchError(res => this.restExtractor.handleError(res))
@@ -69,7 +69,7 @@ export class FollowService {
69 hosts: notEmptyHosts 69 hosts: notEmptyHosts
70 } 70 }
71 71
72 return this.authHttp.post(FollowService.BASE_APPLICATION_URL + '/following', body) 72 return this.authHttp.post(InstanceFollowService.BASE_APPLICATION_URL + '/following', body)
73 .pipe( 73 .pipe(
74 map(this.restExtractor.extractDataBool), 74 map(this.restExtractor.extractDataBool),
75 catchError(res => this.restExtractor.handleError(res)) 75 catchError(res => this.restExtractor.handleError(res))
@@ -77,7 +77,7 @@ export class FollowService {
77 } 77 }
78 78
79 unfollow (follow: ActorFollow) { 79 unfollow (follow: ActorFollow) {
80 return this.authHttp.delete(FollowService.BASE_APPLICATION_URL + '/following/' + follow.following.host) 80 return this.authHttp.delete(InstanceFollowService.BASE_APPLICATION_URL + '/following/' + follow.following.host)
81 .pipe( 81 .pipe(
82 map(this.restExtractor.extractDataBool), 82 map(this.restExtractor.extractDataBool),
83 catchError(res => this.restExtractor.handleError(res)) 83 catchError(res => this.restExtractor.handleError(res))
@@ -87,7 +87,7 @@ export class FollowService {
87 acceptFollower (follow: ActorFollow) { 87 acceptFollower (follow: ActorFollow) {
88 const handle = follow.follower.name + '@' + follow.follower.host 88 const handle = follow.follower.name + '@' + follow.follower.host
89 89
90 return this.authHttp.post(`${FollowService.BASE_APPLICATION_URL}/followers/${handle}/accept`, {}) 90 return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/accept`, {})
91 .pipe( 91 .pipe(
92 map(this.restExtractor.extractDataBool), 92 map(this.restExtractor.extractDataBool),
93 catchError(res => this.restExtractor.handleError(res)) 93 catchError(res => this.restExtractor.handleError(res))
@@ -97,7 +97,7 @@ export class FollowService {
97 rejectFollower (follow: ActorFollow) { 97 rejectFollower (follow: ActorFollow) {
98 const handle = follow.follower.name + '@' + follow.follower.host 98 const handle = follow.follower.name + '@' + follow.follower.host
99 99
100 return this.authHttp.post(`${FollowService.BASE_APPLICATION_URL}/followers/${handle}/reject`, {}) 100 return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/reject`, {})
101 .pipe( 101 .pipe(
102 map(this.restExtractor.extractDataBool), 102 map(this.restExtractor.extractDataBool),
103 catchError(res => this.restExtractor.handleError(res)) 103 catchError(res => this.restExtractor.handleError(res))
@@ -107,7 +107,7 @@ export class FollowService {
107 removeFollower (follow: ActorFollow) { 107 removeFollower (follow: ActorFollow) {
108 const handle = follow.follower.name + '@' + follow.follower.host 108 const handle = follow.follower.name + '@' + follow.follower.host
109 109
110 return this.authHttp.delete(`${FollowService.BASE_APPLICATION_URL}/followers/${handle}`) 110 return this.authHttp.delete(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}`)
111 .pipe( 111 .pipe(
112 map(this.restExtractor.extractDataBool), 112 map(this.restExtractor.extractDataBool),
113 catchError(res => this.restExtractor.handleError(res)) 113 catchError(res => this.restExtractor.handleError(res))
diff --git a/client/src/app/shared/instance/instance-statistics.component.html b/client/src/app/shared/shared-instance/instance-statistics.component.html
index 399cf10fe..399cf10fe 100644
--- a/client/src/app/shared/instance/instance-statistics.component.html
+++ b/client/src/app/shared/shared-instance/instance-statistics.component.html
diff --git a/client/src/app/shared/instance/instance-statistics.component.scss b/client/src/app/shared/shared-instance/instance-statistics.component.scss
index 5286ab03a..5286ab03a 100644
--- a/client/src/app/shared/instance/instance-statistics.component.scss
+++ b/client/src/app/shared/shared-instance/instance-statistics.component.scss
diff --git a/client/src/app/shared/instance/instance-statistics.component.ts b/client/src/app/shared/shared-instance/instance-statistics.component.ts
index 40aa8a4c0..40aa8a4c0 100644
--- a/client/src/app/shared/instance/instance-statistics.component.ts
+++ b/client/src/app/shared/shared-instance/instance-statistics.component.ts
diff --git a/client/src/app/shared/instance/instance.service.ts b/client/src/app/shared/shared-instance/instance.service.ts
index 8b26063fb..ba9797bb5 100644
--- a/client/src/app/shared/instance/instance.service.ts
+++ b/client/src/app/shared/shared-instance/instance.service.ts
@@ -1,13 +1,10 @@
1import { forkJoin } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 2import { catchError, map } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 3import { HttpClient } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
5import { MarkdownService, RestExtractor, ServerService } from '@app/core'
6import { About, peertubeTranslate } from '@shared/models'
4import { environment } from '../../../environments/environment' 7import { environment } from '../../../environments/environment'
5import { RestExtractor, RestService } from '../rest'
6import { About } from '../../../../../shared/models/server'
7import { MarkdownService } from '@app/shared/renderer'
8import { peertubeTranslate } from '@shared/models'
9import { ServerService } from '@app/core'
10import { forkJoin } from 'rxjs'
11 8
12@Injectable() 9@Injectable()
13export class InstanceService { 10export class InstanceService {
@@ -16,7 +13,6 @@ export class InstanceService {
16 13
17 constructor ( 14 constructor (
18 private authHttp: HttpClient, 15 private authHttp: HttpClient,
19 private restService: RestService,
20 private restExtractor: RestExtractor, 16 private restExtractor: RestExtractor,
21 private markdownService: MarkdownService, 17 private markdownService: MarkdownService,
22 private serverService: ServerService 18 private serverService: ServerService
diff --git a/client/src/app/shared/shared-instance/shared-instance.module.ts b/client/src/app/shared/shared-instance/shared-instance.module.ts
new file mode 100644
index 000000000..b75ad1a12
--- /dev/null
+++ b/client/src/app/shared/shared-instance/shared-instance.module.ts
@@ -0,0 +1,32 @@
1
2import { NgModule } from '@angular/core'
3import { SharedMainModule } from '../shared-main/shared-main.module'
4import { FeatureBooleanComponent } from './feature-boolean.component'
5import { InstanceFeaturesTableComponent } from './instance-features-table.component'
6import { InstanceFollowService } from './instance-follow.service'
7import { InstanceStatisticsComponent } from './instance-statistics.component'
8import { InstanceService } from './instance.service'
9
10@NgModule({
11 imports: [
12 SharedMainModule
13 ],
14
15 declarations: [
16 FeatureBooleanComponent,
17 InstanceFeaturesTableComponent,
18 InstanceStatisticsComponent
19 ],
20
21 exports: [
22 FeatureBooleanComponent,
23 InstanceFeaturesTableComponent,
24 InstanceStatisticsComponent
25 ],
26
27 providers: [
28 InstanceFollowService,
29 InstanceService
30 ]
31})
32export class SharedInstanceModule { }
diff --git a/client/src/app/shared/account/account.model.ts b/client/src/app/shared/shared-main/account/account.model.ts
index 61f09fc06..6df2e9d10 100644
--- a/client/src/app/shared/account/account.model.ts
+++ b/client/src/app/shared/shared-main/account/account.model.ts
@@ -1,5 +1,5 @@
1import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model' 1import { Account as ServerAccount } from '@shared/models/actors/account.model'
2import { Actor } from '../actor/actor.model' 2import { Actor } from './actor.model'
3 3
4export class Account extends Actor implements ServerAccount { 4export class Account extends Actor implements ServerAccount {
5 displayName: string 5 displayName: string
diff --git a/client/src/app/shared/account/account.service.ts b/client/src/app/shared/shared-main/account/account.service.ts
index 6b261cf53..8f4abf070 100644
--- a/client/src/app/shared/account/account.service.ts
+++ b/client/src/app/shared/shared-main/account/account.service.ts
@@ -1,11 +1,11 @@
1import { map, tap, catchError } from 'rxjs/operators'
2import { Injectable } from '@angular/core'
3import { environment } from '../../../environments/environment'
4import { Observable, ReplaySubject } from 'rxjs' 1import { Observable, ReplaySubject } from 'rxjs'
5import { Account } from '@app/shared/account/account.model' 2import { catchError, map, tap } from 'rxjs/operators'
6import { RestExtractor } from '@app/shared/rest/rest-extractor.service'
7import { HttpClient } from '@angular/common/http' 3import { HttpClient } from '@angular/common/http'
8import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model' 4import { Injectable } from '@angular/core'
5import { RestExtractor } from '@app/core'
6import { Account as ServerAccount } from '@shared/models'
7import { environment } from '../../../../environments/environment'
8import { Account } from './account.model'
9 9
10@Injectable() 10@Injectable()
11export class AccountService { 11export class AccountService {
diff --git a/client/src/app/+my-account/shared/actor-avatar-info.component.html b/client/src/app/shared/shared-main/account/actor-avatar-info.component.html
index d01b9ac7f..d01b9ac7f 100644
--- a/client/src/app/+my-account/shared/actor-avatar-info.component.html
+++ b/client/src/app/shared/shared-main/account/actor-avatar-info.component.html
diff --git a/client/src/app/+my-account/shared/actor-avatar-info.component.scss b/client/src/app/shared/shared-main/account/actor-avatar-info.component.scss
index 5a66ecfd2..5a66ecfd2 100644
--- a/client/src/app/+my-account/shared/actor-avatar-info.component.scss
+++ b/client/src/app/shared/shared-main/account/actor-avatar-info.component.scss
diff --git a/client/src/app/+my-account/shared/actor-avatar-info.component.ts b/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts
index 8e4a7a602..0c04ae4a6 100644
--- a/client/src/app/+my-account/shared/actor-avatar-info.component.ts
+++ b/client/src/app/shared/shared-main/account/actor-avatar-info.component.ts
@@ -1,11 +1,9 @@
1import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
2import { ServerService } from '../../core/server'
3import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
4import { Account } from '@app/shared/account/account.model'
5import { Notifier } from '@app/core'
6import { ServerConfig } from '@shared/models'
7import { BytesPipe } from 'ngx-pipes' 1import { BytesPipe } from 'ngx-pipes'
2import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
3import { Notifier, ServerService } from '@app/core'
4import { Account, VideoChannel } from '@app/shared/shared-main'
8import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { ServerConfig } from '@shared/models'
9 7
10@Component({ 8@Component({
11 selector: 'my-actor-avatar-info', 9 selector: 'my-actor-avatar-info',
diff --git a/client/src/app/shared/actor/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts
index a78303a2f..5fc7989dd 100644
--- a/client/src/app/shared/actor/actor.model.ts
+++ b/client/src/app/shared/shared-main/account/actor.model.ts
@@ -1,6 +1,5 @@
1import { Actor as ActorServer } from '../../../../../shared/models/actors/actor.model' 1import { Actor as ActorServer, Avatar } from '@shared/models'
2import { Avatar } from '../../../../../shared/models/avatars/avatar.model' 2import { getAbsoluteAPIUrl } from '@app/helpers'
3import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'
4 3
5export abstract class Actor implements ActorServer { 4export abstract class Actor implements ActorServer {
6 id: number 5 id: number
diff --git a/client/src/app/shared/channel/avatar.component.html b/client/src/app/shared/shared-main/account/avatar.component.html
index 09871fca4..09871fca4 100644
--- a/client/src/app/shared/channel/avatar.component.html
+++ b/client/src/app/shared/shared-main/account/avatar.component.html
diff --git a/client/src/app/shared/channel/avatar.component.scss b/client/src/app/shared/shared-main/account/avatar.component.scss
index 37709fce6..37709fce6 100644
--- a/client/src/app/shared/channel/avatar.component.scss
+++ b/client/src/app/shared/shared-main/account/avatar.component.scss
diff --git a/client/src/app/shared/channel/avatar.component.ts b/client/src/app/shared/shared-main/account/avatar.component.ts
index 31f39c200..31f39c200 100644
--- a/client/src/app/shared/channel/avatar.component.ts
+++ b/client/src/app/shared/shared-main/account/avatar.component.ts
diff --git a/client/src/app/shared/shared-main/account/index.ts b/client/src/app/shared/shared-main/account/index.ts
new file mode 100644
index 000000000..f5b9f3634
--- /dev/null
+++ b/client/src/app/shared/shared-main/account/index.ts
@@ -0,0 +1,5 @@
1export * from './account.model'
2export * from './account.service'
3export * from './actor-avatar-info.component'
4export * from './actor.model'
5export * from './avatar.component'
diff --git a/client/src/app/shared/angular/from-now.pipe.ts b/client/src/app/shared/shared-main/angular/from-now.pipe.ts
index 9851468ee..9851468ee 100644
--- a/client/src/app/shared/angular/from-now.pipe.ts
+++ b/client/src/app/shared/shared-main/angular/from-now.pipe.ts
diff --git a/client/src/app/shared/shared-main/angular/index.ts b/client/src/app/shared/shared-main/angular/index.ts
new file mode 100644
index 000000000..3b072fb84
--- /dev/null
+++ b/client/src/app/shared/shared-main/angular/index.ts
@@ -0,0 +1,4 @@
1export * from './from-now.pipe'
2export * from './infinite-scroller.directive'
3export * from './number-formatter.pipe'
4export * from './peertube-template.directive'
diff --git a/client/src/app/shared/video/infinite-scroller.directive.ts b/client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts
index f09c3d1fc..f09c3d1fc 100644
--- a/client/src/app/shared/video/infinite-scroller.directive.ts
+++ b/client/src/app/shared/shared-main/angular/infinite-scroller.directive.ts
diff --git a/client/src/app/shared/angular/number-formatter.pipe.ts b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts
index 8a0756a36..8a0756a36 100644
--- a/client/src/app/shared/angular/number-formatter.pipe.ts
+++ b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts
diff --git a/client/src/app/shared/angular/peertube-template.directive.ts b/client/src/app/shared/shared-main/angular/peertube-template.directive.ts
index e04c25d9a..e04c25d9a 100644
--- a/client/src/app/shared/angular/peertube-template.directive.ts
+++ b/client/src/app/shared/shared-main/angular/peertube-template.directive.ts
diff --git a/client/src/app/shared/auth/auth-interceptor.service.ts b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts
index bb236bf8c..68a4acdb5 100644
--- a/client/src/app/shared/auth/auth-interceptor.service.ts
+++ b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts
@@ -1,8 +1,8 @@
1import { Observable, throwError as observableThrowError } from 'rxjs' 1import { Observable, throwError as observableThrowError } from 'rxjs'
2import { catchError, switchMap } from 'rxjs/operators' 2import { catchError, switchMap } from 'rxjs/operators'
3import { Injectable, Injector } from '@angular/core'
4import { HTTP_INTERCEPTORS, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http' 3import { HTTP_INTERCEPTORS, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'
5import { AuthService } from '../../core' 4import { Injectable, Injector } from '@angular/core'
5import { AuthService } from '@app/core/auth/auth.service'
6 6
7@Injectable() 7@Injectable()
8export class AuthInterceptor implements HttpInterceptor { 8export class AuthInterceptor implements HttpInterceptor {
diff --git a/client/src/app/shared/auth/index.ts b/client/src/app/shared/shared-main/auth/index.ts
index 84a07196f..84a07196f 100644
--- a/client/src/app/shared/auth/index.ts
+++ b/client/src/app/shared/shared-main/auth/index.ts
diff --git a/client/src/app/shared/buttons/action-dropdown.component.html b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html
index 12933d4ca..12933d4ca 100644
--- a/client/src/app/shared/buttons/action-dropdown.component.html
+++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html
diff --git a/client/src/app/shared/buttons/action-dropdown.component.scss b/client/src/app/shared/shared-main/buttons/action-dropdown.component.scss
index 724a04efc..724a04efc 100644
--- a/client/src/app/shared/buttons/action-dropdown.component.scss
+++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.scss
diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts
index 15f9556dc..36d7d6229 100644
--- a/client/src/app/shared/buttons/action-dropdown.component.ts
+++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts
@@ -1,5 +1,5 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { GlobalIconName } from '@app/shared/images/global-icon.component' 2import { GlobalIconName } from '@app/shared/shared-icons'
3 3
4export type DropdownAction<T> = { 4export type DropdownAction<T> = {
5 label?: string 5 label?: string
diff --git a/client/src/app/shared/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html
index d2b0eb81a..d2b0eb81a 100644
--- a/client/src/app/shared/buttons/button.component.html
+++ b/client/src/app/shared/shared-main/buttons/button.component.html
diff --git a/client/src/app/shared/buttons/button.component.scss b/client/src/app/shared/shared-main/buttons/button.component.scss
index 3ccfefd7e..3ccfefd7e 100644
--- a/client/src/app/shared/buttons/button.component.scss
+++ b/client/src/app/shared/shared-main/buttons/button.component.scss
diff --git a/client/src/app/shared/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts
index cac5ad210..e23b90945 100644
--- a/client/src/app/shared/buttons/button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/button.component.ts
@@ -1,5 +1,5 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { GlobalIconName } from '@app/shared/images/global-icon.component' 2import { GlobalIconName } from '@app/shared/shared-icons'
3 3
4@Component({ 4@Component({
5 selector: 'my-button', 5 selector: 'my-button',
diff --git a/client/src/app/shared/buttons/delete-button.component.html b/client/src/app/shared/shared-main/buttons/delete-button.component.html
index 398b6db1e..398b6db1e 100644
--- a/client/src/app/shared/buttons/delete-button.component.html
+++ b/client/src/app/shared/shared-main/buttons/delete-button.component.html
diff --git a/client/src/app/shared/buttons/delete-button.component.ts b/client/src/app/shared/shared-main/buttons/delete-button.component.ts
index 39e31900f..39e31900f 100644
--- a/client/src/app/shared/buttons/delete-button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/delete-button.component.ts
diff --git a/client/src/app/shared/buttons/edit-button.component.html b/client/src/app/shared/shared-main/buttons/edit-button.component.html
index b852bb38a..b852bb38a 100644
--- a/client/src/app/shared/buttons/edit-button.component.html
+++ b/client/src/app/shared/shared-main/buttons/edit-button.component.html
diff --git a/client/src/app/shared/buttons/edit-button.component.ts b/client/src/app/shared/shared-main/buttons/edit-button.component.ts
index 9cfe1a3bb..9cfe1a3bb 100644
--- a/client/src/app/shared/buttons/edit-button.component.ts
+++ b/client/src/app/shared/shared-main/buttons/edit-button.component.ts
diff --git a/client/src/app/shared/shared-main/buttons/index.ts b/client/src/app/shared/shared-main/buttons/index.ts
new file mode 100644
index 000000000..775a47a39
--- /dev/null
+++ b/client/src/app/shared/shared-main/buttons/index.ts
@@ -0,0 +1,4 @@
1export * from './action-dropdown.component'
2export * from './button.component'
3export * from './delete-button.component'
4export * from './edit-button.component'
diff --git a/client/src/app/shared/date/date-toggle.component.html b/client/src/app/shared/shared-main/date/date-toggle.component.html
index ebd4ce442..ebd4ce442 100644
--- a/client/src/app/shared/date/date-toggle.component.html
+++ b/client/src/app/shared/shared-main/date/date-toggle.component.html
diff --git a/client/src/app/shared/date/date-toggle.component.scss b/client/src/app/shared/shared-main/date/date-toggle.component.scss
index 86700d1d4..86700d1d4 100644
--- a/client/src/app/shared/date/date-toggle.component.scss
+++ b/client/src/app/shared/shared-main/date/date-toggle.component.scss
diff --git a/client/src/app/shared/date/date-toggle.component.ts b/client/src/app/shared/shared-main/date/date-toggle.component.ts
index fa48da8e8..bedf0ba4e 100644
--- a/client/src/app/shared/date/date-toggle.component.ts
+++ b/client/src/app/shared/shared-main/date/date-toggle.component.ts
@@ -1,12 +1,11 @@
1import { Component, Input, OnInit, OnChanges } from '@angular/core'
2import { DatePipe } from '@angular/common' 1import { DatePipe } from '@angular/common'
2import { Component, Input, OnChanges, OnInit } from '@angular/core'
3import { FromNowPipe } from '../angular/from-now.pipe' 3import { FromNowPipe } from '../angular/from-now.pipe'
4 4
5@Component({ 5@Component({
6 selector: 'my-date-toggle', 6 selector: 'my-date-toggle',
7 templateUrl: './date-toggle.component.html', 7 templateUrl: './date-toggle.component.html',
8 styleUrls: [ './date-toggle.component.scss' ], 8 styleUrls: [ './date-toggle.component.scss' ]
9 providers: [ DatePipe, FromNowPipe ]
10}) 9})
11export class DateToggleComponent implements OnInit, OnChanges { 10export class DateToggleComponent implements OnInit, OnChanges {
12 @Input() date: Date 11 @Input() date: Date
diff --git a/client/src/app/shared/shared-main/date/index.ts b/client/src/app/shared/shared-main/date/index.ts
new file mode 100644
index 000000000..db00aef52
--- /dev/null
+++ b/client/src/app/shared/shared-main/date/index.ts
@@ -0,0 +1 @@
export * from './date-toggle.component'
diff --git a/client/src/app/shared/video/feed.component.html b/client/src/app/shared/shared-main/feeds/feed.component.html
index ac0b1f454..ac0b1f454 100644
--- a/client/src/app/shared/video/feed.component.html
+++ b/client/src/app/shared/shared-main/feeds/feed.component.html
diff --git a/client/src/app/shared/video/feed.component.scss b/client/src/app/shared/shared-main/feeds/feed.component.scss
index 34dd0e937..34dd0e937 100644
--- a/client/src/app/shared/video/feed.component.scss
+++ b/client/src/app/shared/shared-main/feeds/feed.component.scss
diff --git a/client/src/app/shared/video/feed.component.ts b/client/src/app/shared/shared-main/feeds/feed.component.ts
index 12507458f..ee3731c1d 100644
--- a/client/src/app/shared/video/feed.component.ts
+++ b/client/src/app/shared/shared-main/feeds/feed.component.ts
@@ -1,5 +1,5 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { Syndication } from '@app/shared/video/syndication.model' 2import { Syndication } from './syndication.model'
3 3
4@Component({ 4@Component({
5 selector: 'my-feed', 5 selector: 'my-feed',
diff --git a/client/src/app/shared/shared-main/feeds/index.ts b/client/src/app/shared/shared-main/feeds/index.ts
new file mode 100644
index 000000000..6bc396699
--- /dev/null
+++ b/client/src/app/shared/shared-main/feeds/index.ts
@@ -0,0 +1,2 @@
1export * from './feed.component'
2export * from './syndication.model'
diff --git a/client/src/app/shared/video/syndication.model.ts b/client/src/app/shared/shared-main/feeds/syndication.model.ts
index c59ab01e8..2466ae7c6 100644
--- a/client/src/app/shared/video/syndication.model.ts
+++ b/client/src/app/shared/shared-main/feeds/syndication.model.ts
@@ -1,4 +1,4 @@
1import { FeedFormat } from '../../../../../shared/models/feeds/feed-format.enum' 1import { FeedFormat } from '@shared/models'
2 2
3export interface Syndication { 3export interface Syndication {
4 format: FeedFormat, 4 format: FeedFormat,
diff --git a/client/src/app/shared/shared-main/index.ts b/client/src/app/shared/shared-main/index.ts
new file mode 100644
index 000000000..a4d813c06
--- /dev/null
+++ b/client/src/app/shared/shared-main/index.ts
@@ -0,0 +1,12 @@
1export * from './account'
2export * from './angular'
3export * from './buttons'
4export * from './date'
5export * from './feeds'
6export * from './loaders'
7export * from './misc'
8export * from './users'
9export * from './video'
10export * from './video-caption'
11export * from './video-channel'
12export * from './shared-main.module'
diff --git a/client/src/app/shared/shared-main/loaders/index.ts b/client/src/app/shared/shared-main/loaders/index.ts
new file mode 100644
index 000000000..a061914d5
--- /dev/null
+++ b/client/src/app/shared/shared-main/loaders/index.ts
@@ -0,0 +1,2 @@
1export * from './loader.component'
2export * from './small-loader.component'
diff --git a/client/src/app/shared/misc/loader.component.html b/client/src/app/shared/shared-main/loaders/loader.component.html
index ca8ed063e..ca8ed063e 100644
--- a/client/src/app/shared/misc/loader.component.html
+++ b/client/src/app/shared/shared-main/loaders/loader.component.html
diff --git a/client/src/app/shared/misc/loader.component.scss b/client/src/app/shared/shared-main/loaders/loader.component.scss
index ffac9c707..ffac9c707 100644
--- a/client/src/app/shared/misc/loader.component.scss
+++ b/client/src/app/shared/shared-main/loaders/loader.component.scss
diff --git a/client/src/app/shared/misc/loader.component.ts b/client/src/app/shared/shared-main/loaders/loader.component.ts
index e3b1eea3a..e3b1eea3a 100644
--- a/client/src/app/shared/misc/loader.component.ts
+++ b/client/src/app/shared/shared-main/loaders/loader.component.ts
diff --git a/client/src/app/shared/misc/small-loader.component.html b/client/src/app/shared/shared-main/loaders/small-loader.component.html
index 7886f8918..7886f8918 100644
--- a/client/src/app/shared/misc/small-loader.component.html
+++ b/client/src/app/shared/shared-main/loaders/small-loader.component.html
diff --git a/client/src/app/shared/misc/small-loader.component.ts b/client/src/app/shared/shared-main/loaders/small-loader.component.ts
index 191877f14..191877f14 100644
--- a/client/src/app/shared/misc/small-loader.component.ts
+++ b/client/src/app/shared/shared-main/loaders/small-loader.component.ts
diff --git a/client/src/app/shared/misc/help.component.html b/client/src/app/shared/shared-main/misc/help.component.html
index 9a6d3e48e..9a6d3e48e 100644
--- a/client/src/app/shared/misc/help.component.html
+++ b/client/src/app/shared/shared-main/misc/help.component.html
diff --git a/client/src/app/shared/misc/help.component.scss b/client/src/app/shared/shared-main/misc/help.component.scss
index 43f33a53a..43f33a53a 100644
--- a/client/src/app/shared/misc/help.component.scss
+++ b/client/src/app/shared/shared-main/misc/help.component.scss
diff --git a/client/src/app/shared/misc/help.component.ts b/client/src/app/shared/shared-main/misc/help.component.ts
index e8c199e7d..0825b96de 100644
--- a/client/src/app/shared/misc/help.component.ts
+++ b/client/src/app/shared/shared-main/misc/help.component.ts
@@ -1,7 +1,7 @@
1import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core' 1import { AfterContentInit, Component, ContentChildren, Input, OnChanges, OnInit, QueryList, TemplateRef } from '@angular/core'
2import { MarkdownService } from '@app/core'
2import { I18n } from '@ngx-translate/i18n-polyfill' 3import { I18n } from '@ngx-translate/i18n-polyfill'
3import { MarkdownService } from '@app/shared/renderer' 4import { PeerTubeTemplateDirective } from '../angular'
4import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive'
5 5
6@Component({ 6@Component({
7 selector: 'my-help', 7 selector: 'my-help',
diff --git a/client/src/app/shared/shared-main/misc/index.ts b/client/src/app/shared/shared-main/misc/index.ts
new file mode 100644
index 000000000..d3e7e4be7
--- /dev/null
+++ b/client/src/app/shared/shared-main/misc/index.ts
@@ -0,0 +1,2 @@
1export * from './help.component'
2export * from './list-overflow.component'
diff --git a/client/src/app/shared/misc/list-overflow.component.html b/client/src/app/shared/shared-main/misc/list-overflow.component.html
index 986572801..986572801 100644
--- a/client/src/app/shared/misc/list-overflow.component.html
+++ b/client/src/app/shared/shared-main/misc/list-overflow.component.html
diff --git a/client/src/app/shared/misc/list-overflow.component.scss b/client/src/app/shared/shared-main/misc/list-overflow.component.scss
index 1ec044489..1ec044489 100644
--- a/client/src/app/shared/misc/list-overflow.component.scss
+++ b/client/src/app/shared/shared-main/misc/list-overflow.component.scss
diff --git a/client/src/app/shared/misc/list-overflow.component.ts b/client/src/app/shared/shared-main/misc/list-overflow.component.ts
index 30f43ba43..144e0f156 100644
--- a/client/src/app/shared/misc/list-overflow.component.ts
+++ b/client/src/app/shared/shared-main/misc/list-overflow.component.ts
@@ -1,3 +1,5 @@
1import { lowerFirst, uniqueId } from 'lodash-es'
2import { take } from 'rxjs/operators'
1import { 3import {
2 AfterViewInit, 4 AfterViewInit,
3 ChangeDetectionStrategy, 5 ChangeDetectionStrategy,
@@ -11,10 +13,8 @@ import {
11 ViewChild, 13 ViewChild,
12 ViewChildren 14 ViewChildren
13} from '@angular/core' 15} from '@angular/core'
16import { ScreenService } from '@app/core'
14import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap' 17import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap'
15import { lowerFirst, uniqueId } from 'lodash-es'
16import { ScreenService } from './screen.service'
17import { take } from 'rxjs/operators'
18 18
19export interface ListOverflowItem { 19export interface ListOverflowItem {
20 label: string 20 label: string
diff --git a/client/src/app/shared/shared-main/shared-main.module.ts b/client/src/app/shared/shared-main/shared-main.module.ts
new file mode 100644
index 000000000..fd96a42a0
--- /dev/null
+++ b/client/src/app/shared/shared-main/shared-main.module.ts
@@ -0,0 +1,164 @@
1import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes'
2import { SharedModule as PrimeSharedModule } from 'primeng/api'
3import { InputMaskModule } from 'primeng/inputmask'
4import { InputSwitchModule } from 'primeng/inputswitch'
5import { MultiSelectModule } from 'primeng/multiselect'
6import { ClipboardModule } from '@angular/cdk/clipboard'
7import { CommonModule, DatePipe } from '@angular/common'
8import { HttpClientModule } from '@angular/common/http'
9import { NgModule } from '@angular/core'
10import { FormsModule, ReactiveFormsModule } from '@angular/forms'
11import { RouterModule } from '@angular/router'
12import {
13 NgbCollapseModule,
14 NgbDropdownModule,
15 NgbModalModule,
16 NgbNavModule,
17 NgbPopoverModule,
18 NgbTooltipModule
19} from '@ng-bootstrap/ng-bootstrap'
20import { I18n } from '@ngx-translate/i18n-polyfill'
21import { SharedGlobalIconModule } from '../shared-icons'
22import { AccountService, ActorAvatarInfoComponent, AvatarComponent } from './account'
23import { FromNowPipe, InfiniteScrollerDirective, NumberFormatterPipe, PeerTubeTemplateDirective } from './angular'
24import { ActionDropdownComponent, ButtonComponent, DeleteButtonComponent, EditButtonComponent } from './buttons'
25import { DateToggleComponent } from './date'
26import { FeedComponent } from './feeds'
27import { LoaderComponent, SmallLoaderComponent } from './loaders'
28import { HelpComponent, ListOverflowComponent } from './misc'
29import { UserHistoryService, UserNotificationsComponent, UserNotificationService } from './users'
30import { RedundancyService, VideoImportService, VideoOwnershipService, VideoService } from './video'
31import { VideoCaptionService } from './video-caption'
32import { VideoChannelService } from './video-channel'
33import { AUTH_INTERCEPTOR_PROVIDER } from './auth'
34
35@NgModule({
36 imports: [
37 CommonModule,
38 FormsModule,
39 ReactiveFormsModule,
40 RouterModule,
41 HttpClientModule,
42
43 NgbDropdownModule,
44 NgbModalModule,
45 NgbPopoverModule,
46 NgbNavModule,
47 NgbTooltipModule,
48 NgbCollapseModule,
49
50 ClipboardModule,
51
52 PrimeSharedModule,
53 InputMaskModule,
54 NgPipesModule,
55 MultiSelectModule,
56 InputSwitchModule,
57
58 SharedGlobalIconModule
59 ],
60
61 declarations: [
62 AvatarComponent,
63 ActorAvatarInfoComponent,
64
65 FromNowPipe,
66 InfiniteScrollerDirective,
67 NumberFormatterPipe,
68 PeerTubeTemplateDirective,
69
70 ActionDropdownComponent,
71 ButtonComponent,
72 DeleteButtonComponent,
73 EditButtonComponent,
74
75 DateToggleComponent,
76
77 FeedComponent,
78
79 LoaderComponent,
80 SmallLoaderComponent,
81
82 HelpComponent,
83 ListOverflowComponent,
84
85 UserNotificationsComponent,
86
87 FeedComponent
88 ],
89
90 exports: [
91 CommonModule,
92 FormsModule,
93 ReactiveFormsModule,
94 RouterModule,
95 HttpClientModule,
96
97 NgbDropdownModule,
98 NgbModalModule,
99 NgbPopoverModule,
100 NgbNavModule,
101 NgbTooltipModule,
102 NgbCollapseModule,
103
104 ClipboardModule,
105
106 PrimeSharedModule,
107 InputMaskModule,
108 BytesPipe,
109 KeysPipe,
110 MultiSelectModule,
111
112 AvatarComponent,
113 ActorAvatarInfoComponent,
114
115 FromNowPipe,
116 InfiniteScrollerDirective,
117 NumberFormatterPipe,
118 PeerTubeTemplateDirective,
119
120 ActionDropdownComponent,
121 ButtonComponent,
122 DeleteButtonComponent,
123 EditButtonComponent,
124
125 DateToggleComponent,
126
127 FeedComponent,
128
129 LoaderComponent,
130 SmallLoaderComponent,
131
132 HelpComponent,
133 ListOverflowComponent,
134
135 UserNotificationsComponent,
136
137 FeedComponent
138 ],
139
140 providers: [
141 I18n,
142
143 DatePipe,
144
145 FromNowPipe,
146
147 AUTH_INTERCEPTOR_PROVIDER,
148
149 AccountService,
150
151 UserHistoryService,
152 UserNotificationService,
153
154 RedundancyService,
155 VideoImportService,
156 VideoOwnershipService,
157 VideoService,
158
159 VideoCaptionService,
160
161 VideoChannelService
162 ]
163})
164export class SharedMainModule { }
diff --git a/client/src/app/shared/shared-main/users/index.ts b/client/src/app/shared/shared-main/users/index.ts
new file mode 100644
index 000000000..83401ab52
--- /dev/null
+++ b/client/src/app/shared/shared-main/users/index.ts
@@ -0,0 +1,4 @@
1export * from './user-history.service'
2export * from './user-notification.model'
3export * from './user-notification.service'
4export * from './user-notifications.component'
diff --git a/client/src/app/shared/users/user-history.service.ts b/client/src/app/shared/shared-main/users/user-history.service.ts
index b358cdf20..43970dc5b 100644
--- a/client/src/app/shared/users/user-history.service.ts
+++ b/client/src/app/shared/shared-main/users/user-history.service.ts
@@ -1,13 +1,11 @@
1import { catchError, map, switchMap } from 'rxjs/operators'
1import { HttpClient, HttpParams } from '@angular/common/http' 2import { HttpClient, HttpParams } from '@angular/common/http'
2import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
3import { environment } from '../../../environments/environment' 4import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core'
4import { RestExtractor } from '../rest/rest-extractor.service' 5import { ResultList } from '@shared/models'
5import { RestService } from '../rest/rest.service' 6import { environment } from '../../../../environments/environment'
6import { Video } from '../video/video.model' 7import { Video } from '../video/video.model'
7import { catchError, map, switchMap } from 'rxjs/operators' 8import { VideoService } from '../video/video.service'
8import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model'
9import { VideoService } from '@app/shared/video/video.service'
10import { ResultList } from '../../../../../shared'
11 9
12@Injectable() 10@Injectable()
13export class UserHistoryService { 11export class UserHistoryService {
diff --git a/client/src/app/shared/users/user-notification.model.ts b/client/src/app/shared/shared-main/users/user-notification.model.ts
index 7b8368d87..de25d3ab9 100644
--- a/client/src/app/shared/users/user-notification.model.ts
+++ b/client/src/app/shared/shared-main/users/user-notification.model.ts
@@ -1,5 +1,5 @@
1import { ActorInfo, FollowState, UserNotification as UserNotificationServer, UserNotificationType, VideoInfo, Avatar } from '../../../../../shared' 1import { Actor } from '../account/actor.model'
2import { Actor } from '@app/shared/actor/actor.model' 2import { ActorInfo, Avatar, FollowState, UserNotification as UserNotificationServer, UserNotificationType, VideoInfo } from '@shared/models'
3 3
4export class UserNotification implements UserNotificationServer { 4export class UserNotification implements UserNotificationServer {
5 id: number 5 id: number
diff --git a/client/src/app/shared/users/user-notification.service.ts b/client/src/app/shared/shared-main/users/user-notification.service.ts
index e525a1d58..8dd9472fe 100644
--- a/client/src/app/shared/users/user-notification.service.ts
+++ b/client/src/app/shared/shared-main/users/user-notification.service.ts
@@ -1,14 +1,10 @@
1import { Injectable } from '@angular/core'
2import { HttpClient, HttpParams } from '@angular/common/http'
3import { RestExtractor, RestService } from '../rest'
4import { catchError, map, tap } from 'rxjs/operators' 1import { catchError, map, tap } from 'rxjs/operators'
5import { environment } from '../../../environments/environment' 2import { HttpClient, HttpParams } from '@angular/common/http'
6import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '../../../../../shared' 3import { Injectable } from '@angular/core'
4import { ComponentPaginationLight, RestExtractor, RestService, User, UserNotificationSocket } from '@app/core'
5import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '@shared/models'
6import { environment } from '../../../../environments/environment'
7import { UserNotification } from './user-notification.model' 7import { UserNotification } from './user-notification.model'
8import { AuthService } from '../../core'
9import { ComponentPaginationLight } from '../rest/component-pagination.model'
10import { User } from '../users/user.model'
11import { UserNotificationSocket } from '@app/core/notification/user-notification-socket.service'
12 8
13@Injectable() 9@Injectable()
14export class UserNotificationService { 10export class UserNotificationService {
@@ -16,7 +12,6 @@ export class UserNotificationService {
16 static BASE_NOTIFICATION_SETTINGS = environment.apiUrl + '/api/v1/users/me/notification-settings' 12 static BASE_NOTIFICATION_SETTINGS = environment.apiUrl + '/api/v1/users/me/notification-settings'
17 13
18 constructor ( 14 constructor (
19 private auth: AuthService,
20 private authHttp: HttpClient, 15 private authHttp: HttpClient,
21 private restExtractor: RestExtractor, 16 private restExtractor: RestExtractor,
22 private restService: RestService, 17 private restService: RestService,
diff --git a/client/src/app/shared/users/user-notifications.component.html b/client/src/app/shared/shared-main/users/user-notifications.component.html
index 08771110d..08771110d 100644
--- a/client/src/app/shared/users/user-notifications.component.html
+++ b/client/src/app/shared/shared-main/users/user-notifications.component.html
diff --git a/client/src/app/shared/users/user-notifications.component.scss b/client/src/app/shared/shared-main/users/user-notifications.component.scss
index 5166bd559..5166bd559 100644
--- a/client/src/app/shared/users/user-notifications.component.scss
+++ b/client/src/app/shared/shared-main/users/user-notifications.component.scss
diff --git a/client/src/app/shared/users/user-notifications.component.ts b/client/src/app/shared/shared-main/users/user-notifications.component.ts
index 977dd8925..6abd8b7d8 100644
--- a/client/src/app/shared/users/user-notifications.component.ts
+++ b/client/src/app/shared/shared-main/users/user-notifications.component.ts
@@ -1,10 +1,9 @@
1import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
2import { UserNotificationService } from '@app/shared/users/user-notification.service'
3import { UserNotificationType } from '../../../../../shared'
4import { ComponentPagination, hasMoreItems } from '@app/shared/rest/component-pagination.model'
5import { Notifier } from '@app/core'
6import { UserNotification } from '@app/shared/users/user-notification.model'
7import { Subject } from 'rxjs' 1import { Subject } from 'rxjs'
2import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'
3import { ComponentPagination, hasMoreItems, Notifier } from '@app/core'
4import { UserNotificationType } from '@shared/models'
5import { UserNotification } from './user-notification.model'
6import { UserNotificationService } from './user-notification.service'
8 7
9@Component({ 8@Component({
10 selector: 'my-user-notifications', 9 selector: 'my-user-notifications',
diff --git a/client/src/app/shared/shared-main/video-caption/index.ts b/client/src/app/shared/shared-main/video-caption/index.ts
new file mode 100644
index 000000000..308200f27
--- /dev/null
+++ b/client/src/app/shared/shared-main/video-caption/index.ts
@@ -0,0 +1,2 @@
1export * from './video-caption-edit.model'
2export * from './video-caption.service'
diff --git a/client/src/app/shared/video-caption/video-caption-edit.model.ts b/client/src/app/shared/shared-main/video-caption/video-caption-edit.model.ts
index 732f20158..732f20158 100644
--- a/client/src/app/shared/video-caption/video-caption-edit.model.ts
+++ b/client/src/app/shared/shared-main/video-caption/video-caption-edit.model.ts
diff --git a/client/src/app/shared/video-caption/video-caption.service.ts b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts
index 6bfe67435..d45fb837a 100644
--- a/client/src/app/shared/video-caption/video-caption.service.ts
+++ b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts
@@ -1,14 +1,12 @@
1import { Observable, of } from 'rxjs'
1import { catchError, map, switchMap } from 'rxjs/operators' 2import { catchError, map, switchMap } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 3import { HttpClient } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { Observable, of } from 'rxjs' 5import { RestExtractor, ServerService } from '@app/core'
5import { peertubeTranslate, ResultList } from '../../../../../shared' 6import { objectToFormData, sortBy } from '@app/helpers'
6import { RestExtractor } from '../rest' 7import { VideoService } from '@app/shared/shared-main/video'
7import { VideoService } from '@app/shared/video/video.service' 8import { peertubeTranslate, ResultList, VideoCaption } from '@shared/models'
8import { objectToFormData, sortBy } from '@app/shared/misc/utils' 9import { VideoCaptionEdit } from './video-caption-edit.model'
9import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
10import { VideoCaption } from '../../../../../shared/models/videos/caption/video-caption.model'
11import { ServerService } from '@app/core'
12 10
13@Injectable() 11@Injectable()
14export class VideoCaptionService { 12export class VideoCaptionService {
diff --git a/client/src/app/shared/shared-main/video-channel/index.ts b/client/src/app/shared/shared-main/video-channel/index.ts
new file mode 100644
index 000000000..1fcf6d3be
--- /dev/null
+++ b/client/src/app/shared/shared-main/video-channel/index.ts
@@ -0,0 +1,2 @@
1export * from './video-channel.model'
2export * from './video-channel.service'
diff --git a/client/src/app/shared/video-channel/video-channel.model.ts b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts
index 2f4597343..123389afb 100644
--- a/client/src/app/shared/video-channel/video-channel.model.ts
+++ b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts
@@ -1,6 +1,5 @@
1import { VideoChannel as ServerVideoChannel, ViewsPerDate } from '../../../../../shared/models/videos' 1import { VideoChannel as ServerVideoChannel, ViewsPerDate, Account } from '@shared/models'
2import { Actor } from '../actor/actor.model' 2import { Actor } from '../account/actor.model'
3import { Account } from '../../../../../shared/models/actors'
4 3
5export class VideoChannel extends Actor implements ServerVideoChannel { 4export class VideoChannel extends Actor implements ServerVideoChannel {
6 displayName: string 5 displayName: string
diff --git a/client/src/app/shared/video-channel/video-channel.service.ts b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts
index 0e036bda7..5483e305f 100644
--- a/client/src/app/shared/video-channel/video-channel.service.ts
+++ b/client/src/app/shared/shared-main/video-channel/video-channel.service.ts
@@ -1,17 +1,13 @@
1import { catchError, map, tap } from 'rxjs/operators'
2import { Injectable } from '@angular/core'
3import { Observable, ReplaySubject } from 'rxjs' 1import { Observable, ReplaySubject } from 'rxjs'
4import { RestExtractor } from '../rest/rest-extractor.service' 2import { catchError, map, tap } from 'rxjs/operators'
5import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
6import { VideoChannel as VideoChannelServer, VideoChannelCreate, VideoChannelUpdate } from '../../../../../shared/models/videos' 4import { Injectable } from '@angular/core'
5import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core'
6import { Avatar, ResultList, VideoChannel as VideoChannelServer, VideoChannelCreate, VideoChannelUpdate } from '@shared/models'
7import { environment } from '../../../../environments/environment'
8import { Account } from '../account'
7import { AccountService } from '../account/account.service' 9import { AccountService } from '../account/account.service'
8import { ResultList } from '../../../../../shared'
9import { VideoChannel } from './video-channel.model' 10import { VideoChannel } from './video-channel.model'
10import { environment } from '../../../environments/environment'
11import { Account } from '@app/shared/account/account.model'
12import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
13import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model'
14import { RestService } from '@app/shared/rest'
15 11
16@Injectable() 12@Injectable()
17export class VideoChannelService { 13export class VideoChannelService {
diff --git a/client/src/app/shared/shared-main/video/index.ts b/client/src/app/shared/shared-main/video/index.ts
new file mode 100644
index 000000000..3053df4ef
--- /dev/null
+++ b/client/src/app/shared/shared-main/video/index.ts
@@ -0,0 +1,7 @@
1export * from './redundancy.service'
2export * from './video-details.model'
3export * from './video-edit.model'
4export * from './video-import.service'
5export * from './video-ownership.service'
6export * from './video.model'
7export * from './video.service'
diff --git a/client/src/app/shared/video/redundancy.service.ts b/client/src/app/shared/shared-main/video/redundancy.service.ts
index fb918d73b..6e839e655 100644
--- a/client/src/app/shared/video/redundancy.service.ts
+++ b/client/src/app/shared/shared-main/video/redundancy.service.ts
@@ -1,11 +1,11 @@
1import { SortMeta } from 'primeng/api'
2import { concat, Observable } from 'rxjs'
1import { catchError, map, toArray } from 'rxjs/operators' 3import { catchError, map, toArray } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
4import { RestExtractor, RestPagination, RestService } from '@app/shared/rest' 6import { RestExtractor, RestPagination, RestService } from '@app/core'
5import { SortMeta } from 'primeng/api'
6import { ResultList, Video, VideoRedundanciesTarget, VideoRedundancy } from '@shared/models' 7import { ResultList, Video, VideoRedundanciesTarget, VideoRedundancy } from '@shared/models'
7import { concat, Observable } from 'rxjs' 8import { environment } from '../../../../environments/environment'
8import { environment } from '../../../environments/environment'
9 9
10@Injectable() 10@Injectable()
11export class RedundancyService { 11export class RedundancyService {
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/shared-main/video/video-details.model.ts
index 14347a109..a1cb051e9 100644
--- a/client/src/app/shared/video/video-details.model.ts
+++ b/client/src/app/shared/shared-main/video/video-details.model.ts
@@ -1,9 +1,14 @@
1import { VideoConstant, VideoDetails as VideoDetailsServerModel, VideoFile, VideoState } from '../../../../../shared' 1import { Account } from '@app/shared/shared-main/account/account.model'
2import { Video } from '../../shared/video/video.model' 2import { VideoChannel } from '@app/shared/shared-main/video-channel/video-channel.model'
3import { Account } from '@app/shared/account/account.model' 3import {
4import { VideoChannel } from '@app/shared/video-channel/video-channel.model' 4 VideoConstant,
5import { VideoStreamingPlaylist } from '../../../../../shared/models/videos/video-streaming-playlist.model' 5 VideoDetails as VideoDetailsServerModel,
6import { VideoStreamingPlaylistType } from '../../../../../shared/models/videos/video-streaming-playlist.type' 6 VideoFile,
7 VideoState,
8 VideoStreamingPlaylist,
9 VideoStreamingPlaylistType
10} from '@shared/models'
11import { Video } from './video.model'
7 12
8export class VideoDetails extends Video implements VideoDetailsServerModel { 13export class VideoDetails extends Video implements VideoDetailsServerModel {
9 descriptionPath: string 14 descriptionPath: string
diff --git a/client/src/app/shared/video/video-edit.model.ts b/client/src/app/shared/shared-main/video/video-edit.model.ts
index 67d8e7711..6a529e052 100644
--- a/client/src/app/shared/video/video-edit.model.ts
+++ b/client/src/app/shared/shared-main/video/video-edit.model.ts
@@ -1,7 +1,4 @@
1import { VideoPrivacy } from '../../../../../shared/models/videos/video-privacy.enum' 1import { Video, VideoPrivacy, VideoScheduleUpdate, VideoUpdate } from '@shared/models'
2import { VideoUpdate } from '../../../../../shared/models/videos'
3import { VideoScheduleUpdate } from '../../../../../shared/models/videos/video-schedule-update.model'
4import { Video } from '../../../../../shared/models/videos/video.model'
5 2
6export class VideoEdit implements VideoUpdate { 3export class VideoEdit implements VideoUpdate {
7 static readonly SPECIAL_SCHEDULED_PRIVACY = -1 4 static readonly SPECIAL_SCHEDULED_PRIVACY = -1
diff --git a/client/src/app/shared/video-import/video-import.service.ts b/client/src/app/shared/shared-main/video/video-import.service.ts
index afd9e3fb5..a700abacb 100644
--- a/client/src/app/shared/video-import/video-import.service.ts
+++ b/client/src/app/shared/shared-main/video/video-import.service.ts
@@ -1,17 +1,12 @@
1import { SortMeta } from 'primeng/api'
2import { Observable } from 'rxjs'
1import { catchError, map, switchMap } from 'rxjs/operators' 3import { catchError, map, switchMap } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
4import { Observable } from 'rxjs' 6import { RestExtractor, RestPagination, RestService, ServerService, UserService } from '@app/core'
5import { peertubeTranslate, VideoImport } from '../../../../../shared' 7import { objectToFormData } from '@app/helpers'
6import { environment } from '../../../environments/environment' 8import { peertubeTranslate, ResultList, VideoImport, VideoImportCreate, VideoUpdate } from '@shared/models'
7import { RestExtractor, RestService } from '../rest' 9import { environment } from '../../../../environments/environment'
8import { VideoImportCreate, VideoUpdate } from '../../../../../shared/models/videos'
9import { objectToFormData } from '@app/shared/misc/utils'
10import { ResultList } from '../../../../../shared/models/result-list.model'
11import { UserService } from '@app/shared/users/user.service'
12import { SortMeta } from 'primeng/api'
13import { RestPagination } from '@app/shared/rest'
14import { ServerService } from '@app/core'
15 10
16@Injectable() 11@Injectable()
17export class VideoImportService { 12export class VideoImportService {
diff --git a/client/src/app/shared/video-ownership/video-ownership.service.ts b/client/src/app/shared/shared-main/video/video-ownership.service.ts
index b95d5b792..273930a6c 100644
--- a/client/src/app/shared/video-ownership/video-ownership.service.ts
+++ b/client/src/app/shared/shared-main/video/video-ownership.service.ts
@@ -1,14 +1,11 @@
1import { SortMeta } from 'primeng/api'
2import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 3import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
4import { environment } from '../../../environments/environment' 6import { RestExtractor, RestPagination, RestService } from '@app/core'
5import { RestExtractor, RestService } from '../rest' 7import { ResultList, VideoChangeOwnership, VideoChangeOwnershipAccept, VideoChangeOwnershipCreate } from '@shared/models'
6import { VideoChangeOwnershipCreate } from '../../../../../shared/models/videos' 8import { environment } from '../../../../environments/environment'
7import { Observable } from 'rxjs/index'
8import { SortMeta } from 'primeng/api'
9import { ResultList, VideoChangeOwnership } from '../../../../../shared'
10import { RestPagination } from '@app/shared/rest'
11import { VideoChangeOwnershipAccept } from '../../../../../shared/models/videos/video-change-ownership-accept.model'
12 9
13@Injectable() 10@Injectable()
14export class VideoOwnershipService { 11export class VideoOwnershipService {
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts
index dc5f45626..3e6d6a38d 100644
--- a/client/src/app/shared/video/video.model.ts
+++ b/client/src/app/shared/shared-main/video/video.model.ts
@@ -1,13 +1,19 @@
1import { User } from '../'
2import { UserRight, Video as VideoServerModel, VideoPrivacy, VideoState } from '../../../../../shared'
3import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
4import { VideoConstant } from '../../../../../shared/models/videos/video-constant.model'
5import { durationToString, getAbsoluteAPIUrl } from '../misc/utils'
6import { peertubeTranslate, ServerConfig } from '../../../../../shared/models'
7import { Actor } from '@app/shared/actor/actor.model'
8import { VideoScheduleUpdate } from '../../../../../shared/models/videos/video-schedule-update.model'
9import { AuthUser } from '@app/core' 1import { AuthUser } from '@app/core'
10import { environment } from '../../../environments/environment' 2import { User } from '@app/core/users/user.model'
3import { durationToString, getAbsoluteAPIUrl } from '@app/helpers'
4import {
5 Avatar,
6 peertubeTranslate,
7 ServerConfig,
8 UserRight,
9 Video as VideoServerModel,
10 VideoConstant,
11 VideoPrivacy,
12 VideoScheduleUpdate,
13 VideoState
14} from '@shared/models'
15import { environment } from '../../../../environments/environment'
16import { Actor } from '../account/actor.model'
11 17
12export class Video implements VideoServerModel { 18export class Video implements VideoServerModel {
13 byVideoChannel: string 19 byVideoChannel: string
diff --git a/client/src/app/shared/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts
index d66a1f809..20d13fa10 100644
--- a/client/src/app/shared/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -1,38 +1,32 @@
1import { FfprobeData } from 'fluent-ffmpeg'
2import { Observable } from 'rxjs'
1import { catchError, map, switchMap } from 'rxjs/operators' 3import { catchError, map, switchMap } from 'rxjs/operators'
2import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' 4import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http'
3import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
4import { Observable } from 'rxjs' 6import { ComponentPaginationLight, RestExtractor, RestService, ServerService, UserService } from '@app/core'
5import { Video as VideoServerModel, VideoDetails as VideoDetailsServerModel } from '../../../../../shared' 7import { objectToFormData } from '@app/helpers'
6import { ResultList } from '../../../../../shared/models/result-list.model' 8import { I18n } from '@ngx-translate/i18n-polyfill'
7import { 9import {
10 FeedFormat,
11 NSFWPolicyType,
12 ResultList,
8 UserVideoRate, 13 UserVideoRate,
9 UserVideoRateType, 14 UserVideoRateType,
10 UserVideoRateUpdate, 15 UserVideoRateUpdate,
16 Video as VideoServerModel,
11 VideoConstant, 17 VideoConstant,
18 VideoDetails as VideoDetailsServerModel,
12 VideoFilter, 19 VideoFilter,
13 VideoPrivacy, 20 VideoPrivacy,
21 VideoSortField,
14 VideoUpdate 22 VideoUpdate
15} from '../../../../../shared/models/videos' 23} from '@shared/models'
16import { FeedFormat } from '../../../../../shared/models/feeds/feed-format.enum' 24import { environment } from '../../../../environments/environment'
17import { environment } from '../../../environments/environment' 25import { Account, AccountService } from '../account'
18import { ComponentPaginationLight } from '../rest/component-pagination.model' 26import { VideoChannel, VideoChannelService } from '../video-channel'
19import { RestExtractor } from '../rest/rest-extractor.service'
20import { RestService } from '../rest/rest.service'
21import { UserService } from '../users/user.service'
22import { VideoSortField } from './sort-field.type'
23import { VideoDetails } from './video-details.model' 27import { VideoDetails } from './video-details.model'
24import { VideoEdit } from './video-edit.model' 28import { VideoEdit } from './video-edit.model'
25import { Video } from './video.model' 29import { Video } from './video.model'
26import { objectToFormData } from '@app/shared/misc/utils'
27import { Account } from '@app/shared/account/account.model'
28import { AccountService } from '@app/shared/account/account.service'
29import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
30import { ServerService, AuthService } from '@app/core'
31import { UserSubscriptionService } from '@app/shared/user-subscription/user-subscription.service'
32import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
33import { I18n } from '@ngx-translate/i18n-polyfill'
34import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type'
35import { FfprobeData } from 'fluent-ffmpeg'
36 30
37export interface VideosProvider { 31export interface VideosProvider {
38 getVideos (parameters: { 32 getVideos (parameters: {
@@ -52,8 +46,6 @@ export class VideoService implements VideosProvider {
52 46
53 constructor ( 47 constructor (
54 private authHttp: HttpClient, 48 private authHttp: HttpClient,
55 private authService: AuthService,
56 private userService: UserService,
57 private restExtractor: RestExtractor, 49 private restExtractor: RestExtractor,
58 private restService: RestService, 50 private restService: RestService,
59 private serverService: ServerService, 51 private serverService: ServerService,
@@ -182,27 +174,6 @@ export class VideoService implements VideosProvider {
182 ) 174 )
183 } 175 }
184 176
185 getUserSubscriptionVideos (parameters: {
186 videoPagination: ComponentPaginationLight,
187 sort: VideoSortField,
188 skipCount?: boolean
189 }): Observable<ResultList<Video>> {
190 const { videoPagination, sort, skipCount } = parameters
191 const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
192
193 let params = new HttpParams()
194 params = this.restService.addRestGetParams(params, pagination, sort)
195
196 if (skipCount) params = params.set('skipCount', skipCount + '')
197
198 return this.authHttp
199 .get<ResultList<Video>>(UserSubscriptionService.BASE_USER_SUBSCRIPTIONS_URL + '/videos', { params })
200 .pipe(
201 switchMap(res => this.extractVideos(res)),
202 catchError(err => this.restExtractor.handleError(err))
203 )
204 }
205
206 getVideos (parameters: { 177 getVideos (parameters: {
207 videoPagination: ComponentPaginationLight, 178 videoPagination: ComponentPaginationLight,
208 sort: VideoSortField, 179 sort: VideoSortField,
diff --git a/client/src/app/shared/blocklist/account-block.model.ts b/client/src/app/shared/shared-moderation/account-block.model.ts
index e7b433d88..8f76c69dc 100644
--- a/client/src/app/shared/blocklist/account-block.model.ts
+++ b/client/src/app/shared/shared-moderation/account-block.model.ts
@@ -1,5 +1,5 @@
1import { AccountBlock as AccountBlockServer } from '../../../../../shared' 1import { AccountBlock as AccountBlockServer } from '@shared/models'
2import { Account } from '../account/account.model' 2import { Account } from '@app/shared/shared-main'
3 3
4export class AccountBlock implements AccountBlockServer { 4export class AccountBlock implements AccountBlockServer {
5 byAccount: Account 5 byAccount: Account
diff --git a/client/src/app/shared/blocklist/account-blocklist.component.html b/client/src/app/shared/shared-moderation/account-blocklist.component.html
index 486785f35..486785f35 100644
--- a/client/src/app/shared/blocklist/account-blocklist.component.html
+++ b/client/src/app/shared/shared-moderation/account-blocklist.component.html
diff --git a/client/src/app/shared/blocklist/account-blocklist.component.scss b/client/src/app/shared/shared-moderation/account-blocklist.component.scss
index aa8363ff4..aa8363ff4 100644
--- a/client/src/app/shared/blocklist/account-blocklist.component.scss
+++ b/client/src/app/shared/shared-moderation/account-blocklist.component.scss
diff --git a/client/src/app/shared/blocklist/account-blocklist.component.ts b/client/src/app/shared/shared-moderation/account-blocklist.component.ts
index dc5ac4044..38e0d0424 100644
--- a/client/src/app/shared/blocklist/account-blocklist.component.ts
+++ b/client/src/app/shared/shared-moderation/account-blocklist.component.ts
@@ -1,11 +1,10 @@
1import { SortMeta } from 'primeng/api'
1import { OnInit } from '@angular/core' 2import { OnInit } from '@angular/core'
2import { Notifier } from '@app/core' 3import { Notifier, RestPagination, RestTable } from '@app/core'
4import { Actor } from '@app/shared/shared-main'
3import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
4import { RestPagination, RestTable } from '@app/shared/rest'
5import { SortMeta } from 'primeng/api'
6import { AccountBlock } from './account-block.model' 6import { AccountBlock } from './account-block.model'
7import { BlocklistService, BlocklistComponentType } from './blocklist.service' 7import { BlocklistComponentType, BlocklistService } from './blocklist.service'
8import { Actor } from '@app/shared/actor/actor.model'
9 8
10export class GenericAccountBlocklistComponent extends RestTable implements OnInit { 9export class GenericAccountBlocklistComponent extends RestTable implements OnInit {
11 // @ts-ignore: "Abstract methods can only appear within an abstract class" 10 // @ts-ignore: "Abstract methods can only appear within an abstract class"
diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.html b/client/src/app/shared/shared-moderation/batch-domains-modal.component.html
index 1b85c8f48..1b85c8f48 100644
--- a/client/src/app/+admin/config/shared/batch-domains-modal.component.html
+++ b/client/src/app/shared/shared-moderation/batch-domains-modal.component.html
diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.scss b/client/src/app/shared/shared-moderation/batch-domains-modal.component.scss
index 9621a566f..9621a566f 100644
--- a/client/src/app/+admin/config/shared/batch-domains-modal.component.scss
+++ b/client/src/app/shared/shared-moderation/batch-domains-modal.component.scss
diff --git a/client/src/app/+admin/config/shared/batch-domains-modal.component.ts b/client/src/app/shared/shared-moderation/batch-domains-modal.component.ts
index 620f2726b..fdd4a79a9 100644
--- a/client/src/app/+admin/config/shared/batch-domains-modal.component.ts
+++ b/client/src/app/shared/shared-moderation/batch-domains-modal.component.ts
@@ -1,10 +1,8 @@
1import { Component, OnInit, ViewChild, Input, Output, EventEmitter } from '@angular/core' 1import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
2import { I18n } from '@ngx-translate/i18n-polyfill' 2import { BatchDomainsValidatorsService, FormReactive, FormValidatorService } from '@app/shared/shared-forms'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 4import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
5import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { FormReactive } from '@app/shared/forms'
7import { BatchDomainsValidatorsService } from './batch-domains-validators.service'
8 6
9@Component({ 7@Component({
10 selector: 'my-batch-domains-modal', 8 selector: 'my-batch-domains-modal',
diff --git a/client/src/app/shared/blocklist/blocklist.service.ts b/client/src/app/shared/shared-moderation/blocklist.service.ts
index c70a8173a..0caa92782 100644
--- a/client/src/app/shared/blocklist/blocklist.service.ts
+++ b/client/src/app/shared/shared-moderation/blocklist.service.ts
@@ -1,12 +1,12 @@
1import { Injectable } from '@angular/core'
2import { environment } from '../../../environments/environment'
3import { HttpClient, HttpParams } from '@angular/common/http'
4import { RestExtractor, RestPagination, RestService } from '../rest'
5import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
6import { catchError, map } from 'rxjs/operators' 2import { catchError, map } from 'rxjs/operators'
7import { AccountBlock as AccountBlockServer, ResultList, ServerBlock } from '../../../../../shared' 3import { HttpClient, HttpParams } from '@angular/common/http'
8import { Account } from '@app/shared/account/account.model' 4import { Injectable } from '@angular/core'
9import { AccountBlock } from '@app/shared/blocklist/account-block.model' 5import { RestExtractor, RestPagination, RestService } from '@app/core'
6import { AccountBlock as AccountBlockServer, ResultList, ServerBlock } from '@shared/models'
7import { environment } from '../../../environments/environment'
8import { Account } from '../shared-main'
9import { AccountBlock } from './account-block.model'
10 10
11export enum BlocklistComponentType { Account, Instance } 11export enum BlocklistComponentType { Account, Instance }
12 12
diff --git a/client/src/app/shared/bulk/bulk.service.ts b/client/src/app/shared/shared-moderation/bulk.service.ts
index b00db31ec..f0b869421 100644
--- a/client/src/app/shared/bulk/bulk.service.ts
+++ b/client/src/app/shared/shared-moderation/bulk.service.ts
@@ -1,9 +1,9 @@
1import { catchError } from 'rxjs/operators'
1import { HttpClient } from '@angular/common/http' 2import { HttpClient } from '@angular/common/http'
2import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { RestExtractor } from '@app/core'
5import { BulkRemoveCommentsOfBody } from '@shared/models'
3import { environment } from '../../../environments/environment' 6import { environment } from '../../../environments/environment'
4import { RestExtractor, RestService } from '../rest'
5import { BulkRemoveCommentsOfBody } from '../../../../../shared'
6import { catchError } from 'rxjs/operators'
7 7
8@Injectable() 8@Injectable()
9export class BulkService { 9export class BulkService {
@@ -11,8 +11,7 @@ export class BulkService {
11 11
12 constructor ( 12 constructor (
13 private authHttp: HttpClient, 13 private authHttp: HttpClient,
14 private restExtractor: RestExtractor, 14 private restExtractor: RestExtractor
15 private restService: RestService
16 ) { } 15 ) { }
17 16
18 removeCommentsOf (body: BulkRemoveCommentsOfBody) { 17 removeCommentsOf (body: BulkRemoveCommentsOfBody) {
diff --git a/client/src/app/shared/shared-moderation/index.ts b/client/src/app/shared/shared-moderation/index.ts
new file mode 100644
index 000000000..8e74254f6
--- /dev/null
+++ b/client/src/app/shared/shared-moderation/index.ts
@@ -0,0 +1,13 @@
1export * from './account-block.model'
2export * from './account-blocklist.component'
3export * from './batch-domains-modal.component'
4export * from './blocklist.service'
5export * from './bulk.service'
6export * from './server-blocklist.component'
7export * from './user-ban-modal.component'
8export * from './user-moderation-dropdown.component'
9export * from './video-abuse.service'
10export * from './video-block.component'
11export * from './video-block.service'
12export * from './video-report.component'
13export * from './shared-moderation.module'
diff --git a/client/src/app/shared/blocklist/server-blocklist.component.html b/client/src/app/shared/shared-moderation/server-blocklist.component.html
index 977e0e141..977e0e141 100644
--- a/client/src/app/shared/blocklist/server-blocklist.component.html
+++ b/client/src/app/shared/shared-moderation/server-blocklist.component.html
diff --git a/client/src/app/shared/blocklist/server-blocklist.component.scss b/client/src/app/shared/shared-moderation/server-blocklist.component.scss
index 9ddb76850..9ddb76850 100644
--- a/client/src/app/shared/blocklist/server-blocklist.component.scss
+++ b/client/src/app/shared/shared-moderation/server-blocklist.component.scss
diff --git a/client/src/app/shared/blocklist/server-blocklist.component.ts b/client/src/app/shared/shared-moderation/server-blocklist.component.ts
index f2b36badc..d904d0605 100644
--- a/client/src/app/shared/blocklist/server-blocklist.component.ts
+++ b/client/src/app/shared/shared-moderation/server-blocklist.component.ts
@@ -1,11 +1,10 @@
1import { SortMeta } from 'primeng/api'
1import { OnInit, ViewChild } from '@angular/core' 2import { OnInit, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core' 3import { BatchDomainsModalComponent } from '@app/shared/shared-moderation/batch-domains-modal.component'
4import { Notifier, RestPagination, RestTable } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
4import { RestPagination, RestTable } from '@app/shared/rest' 6import { ServerBlock } from '@shared/models'
5import { SortMeta } from 'primeng/api' 7import { BlocklistComponentType, BlocklistService } from './blocklist.service'
6import { BlocklistService, BlocklistComponentType } from './blocklist.service'
7import { ServerBlock } from '../../../../../shared/models/blocklist/server-block.model'
8import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-domains-modal.component'
9 8
10export class GenericServerBlocklistComponent extends RestTable implements OnInit { 9export class GenericServerBlocklistComponent extends RestTable implements OnInit {
11 @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent 10 @ViewChild('batchDomainsModal') batchDomainsModal: BatchDomainsModalComponent
@@ -26,13 +25,13 @@ export class GenericServerBlocklistComponent extends RestTable implements OnInit
26 super() 25 super()
27 } 26 }
28 27
28 // @ts-ignore: "Abstract methods can only appear within an abstract class"
29 public abstract getIdentifier (): string
30
29 ngOnInit () { 31 ngOnInit () {
30 this.initialize() 32 this.initialize()
31 } 33 }
32 34
33 // @ts-ignore: "Abstract methods can only appear within an abstract class"
34 public abstract getIdentifier (): string
35
36 unblockServer (serverBlock: ServerBlock) { 35 unblockServer (serverBlock: ServerBlock) {
37 const operation = (host: string) => this.mode === BlocklistComponentType.Account 36 const operation = (host: string) => this.mode === BlocklistComponentType.Account
38 ? this.blocklistService.unblockServerByUser(host) 37 ? this.blocklistService.unblockServerByUser(host)
diff --git a/client/src/app/shared/shared-moderation/shared-moderation.module.ts b/client/src/app/shared/shared-moderation/shared-moderation.module.ts
new file mode 100644
index 000000000..f7e64dfa3
--- /dev/null
+++ b/client/src/app/shared/shared-moderation/shared-moderation.module.ts
@@ -0,0 +1,46 @@
1
2import { NgModule } from '@angular/core'
3import { SharedFormModule } from '../shared-forms/shared-form.module'
4import { SharedGlobalIconModule } from '../shared-icons'
5import { SharedMainModule } from '../shared-main/shared-main.module'
6import { BatchDomainsModalComponent } from './batch-domains-modal.component'
7import { BlocklistService } from './blocklist.service'
8import { BulkService } from './bulk.service'
9import { UserBanModalComponent } from './user-ban-modal.component'
10import { UserModerationDropdownComponent } from './user-moderation-dropdown.component'
11import { VideoAbuseService } from './video-abuse.service'
12import { VideoBlockComponent } from './video-block.component'
13import { VideoBlockService } from './video-block.service'
14import { VideoReportComponent } from './video-report.component'
15
16@NgModule({
17 imports: [
18 SharedMainModule,
19 SharedFormModule,
20 SharedGlobalIconModule
21 ],
22
23 declarations: [
24 UserBanModalComponent,
25 UserModerationDropdownComponent,
26 VideoBlockComponent,
27 VideoReportComponent,
28 BatchDomainsModalComponent
29 ],
30
31 exports: [
32 UserBanModalComponent,
33 UserModerationDropdownComponent,
34 VideoBlockComponent,
35 VideoReportComponent,
36 BatchDomainsModalComponent
37 ],
38
39 providers: [
40 BlocklistService,
41 BulkService,
42 VideoAbuseService,
43 VideoBlockService
44 ]
45})
46export class SharedModerationModule { }
diff --git a/client/src/app/shared/moderation/user-ban-modal.component.html b/client/src/app/shared/shared-moderation/user-ban-modal.component.html
index 365eb1938..365eb1938 100644
--- a/client/src/app/shared/moderation/user-ban-modal.component.html
+++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.html
diff --git a/client/src/app/shared/moderation/user-ban-modal.component.scss b/client/src/app/shared/shared-moderation/user-ban-modal.component.scss
index 84562f15c..84562f15c 100644
--- a/client/src/app/shared/moderation/user-ban-modal.component.scss
+++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.scss
diff --git a/client/src/app/shared/moderation/user-ban-modal.component.ts b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts
index 1647e3691..124e58669 100644
--- a/client/src/app/shared/moderation/user-ban-modal.component.ts
+++ b/client/src/app/shared/shared-moderation/user-ban-modal.component.ts
@@ -1,12 +1,10 @@
1import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
2import { Notifier } from '@app/core' 2import { Notifier, UserService } from '@app/core'
3import { I18n } from '@ngx-translate/i18n-polyfill' 3import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
4import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 4import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
5import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 5import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
6import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { FormReactive, UserValidatorsService } from '@app/shared/forms' 7import { User } from '@shared/models'
8import { UserService } from '@app/shared/users'
9import { User } from '../../../../../shared'
10 8
11@Component({ 9@Component({
12 selector: 'my-user-ban-modal', 10 selector: 'my-user-ban-modal',
diff --git a/client/src/app/shared/moderation/user-moderation-dropdown.component.html b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.html
index 4d562387a..4d562387a 100644
--- a/client/src/app/shared/moderation/user-moderation-dropdown.component.html
+++ b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.html
diff --git a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
index 82f39050e..d3c37f082 100644
--- a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts
+++ b/client/src/app/shared/shared-moderation/user-moderation-dropdown.component.ts
@@ -1,14 +1,11 @@
1import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core'
2import { AuthService, ConfirmService, Notifier, ServerService, UserService } from '@app/core'
3import { Account, DropdownAction } from '@app/shared/shared-main'
2import { I18n } from '@ngx-translate/i18n-polyfill' 4import { I18n } from '@ngx-translate/i18n-polyfill'
3import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' 5import { BulkRemoveCommentsOfBody, ServerConfig, User, UserRight } from '@shared/models'
4import { UserBanModalComponent } from '@app/shared/moderation/user-ban-modal.component' 6import { BlocklistService } from './blocklist.service'
5import { UserService } from '@app/shared/users' 7import { BulkService } from './bulk.service'
6import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' 8import { UserBanModalComponent } from './user-ban-modal.component'
7import { User, UserRight } from '../../../../../shared/models/users'
8import { Account } from '@app/shared/account/account.model'
9import { BlocklistService } from '@app/shared/blocklist'
10import { ServerConfig, BulkRemoveCommentsOfBody } from '@shared/models'
11import { BulkService } from '../bulk/bulk.service'
12 9
13@Component({ 10@Component({
14 selector: 'my-user-moderation-dropdown', 11 selector: 'my-user-moderation-dropdown',
diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/shared-moderation/video-abuse.service.ts
index 43f4674b1..44dea44a5 100644
--- a/client/src/app/shared/video-abuse/video-abuse.service.ts
+++ b/client/src/app/shared/shared-moderation/video-abuse.service.ts
@@ -1,12 +1,12 @@
1import { omit } from 'lodash-es'
2import { SortMeta } from 'primeng/api'
3import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 4import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 5import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 6import { Injectable } from '@angular/core'
4import { SortMeta } from 'primeng/api' 7import { RestExtractor, RestPagination, RestService } from '@app/core'
5import { Observable } from 'rxjs' 8import { ResultList, VideoAbuse, VideoAbuseCreate, VideoAbuseState, VideoAbuseUpdate } from '@shared/models'
6import { ResultList, VideoAbuse, VideoAbuseCreate, VideoAbuseState, VideoAbuseUpdate } from '../../../../../shared'
7import { environment } from '../../../environments/environment' 9import { environment } from '../../../environments/environment'
8import { RestExtractor, RestPagination, RestService } from '../rest'
9import { omit } from 'lodash-es'
10 10
11@Injectable() 11@Injectable()
12export class VideoAbuseService { 12export class VideoAbuseService {
diff --git a/client/src/app/shared/video/modals/video-block.component.html b/client/src/app/shared/shared-moderation/video-block.component.html
index 5e73d66c5..5e73d66c5 100644
--- a/client/src/app/shared/video/modals/video-block.component.html
+++ b/client/src/app/shared/shared-moderation/video-block.component.html
diff --git a/client/src/app/shared/video/modals/video-block.component.scss b/client/src/app/shared/shared-moderation/video-block.component.scss
index afcdb9a16..afcdb9a16 100644
--- a/client/src/app/shared/video/modals/video-block.component.scss
+++ b/client/src/app/shared/shared-moderation/video-block.component.scss
diff --git a/client/src/app/shared/video/modals/video-block.component.ts b/client/src/app/shared/shared-moderation/video-block.component.ts
index 1a25e0578..054651e71 100644
--- a/client/src/app/shared/video/modals/video-block.component.ts
+++ b/client/src/app/shared/shared-moderation/video-block.component.ts
@@ -1,12 +1,11 @@
1import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
2import { Notifier, RedirectService } from '@app/core' 2import { Notifier } from '@app/core'
3import { VideoBlockService } from '../../video-block' 3import { FormReactive, FormValidatorService, VideoBlockValidatorsService } from '@app/shared/shared-forms'
4import { I18n } from '@ngx-translate/i18n-polyfill' 4import { Video } from '@app/shared/shared-main'
5import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
6import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 5import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
7import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 6import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
8import { FormReactive, VideoBlockValidatorsService } from '@app/shared/forms' 7import { I18n } from '@ngx-translate/i18n-polyfill'
9import { Video } from '@app/shared/video/video.model' 8import { VideoBlockService } from './video-block.service'
10 9
11@Component({ 10@Component({
12 selector: 'my-video-block', 11 selector: 'my-video-block',
diff --git a/client/src/app/shared/video-block/video-block.service.ts b/client/src/app/shared/shared-moderation/video-block.service.ts
index d0673ddba..c22ceefcc 100644
--- a/client/src/app/shared/video-block/video-block.service.ts
+++ b/client/src/app/shared/shared-moderation/video-block.service.ts
@@ -1,11 +1,11 @@
1import { catchError, map, concatMap, toArray } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core'
4import { SortMeta } from 'primeng/api' 1import { SortMeta } from 'primeng/api'
5import { from as observableFrom, Observable } from 'rxjs' 2import { from as observableFrom, Observable } from 'rxjs'
6import { VideoBlacklist, VideoBlacklistType, ResultList } from '../../../../../shared' 3import { catchError, concatMap, map, toArray } from 'rxjs/operators'
4import { HttpClient, HttpParams } from '@angular/common/http'
5import { Injectable } from '@angular/core'
6import { RestExtractor, RestPagination, RestService } from '@app/core'
7import { ResultList, VideoBlacklist, VideoBlacklistType } from '@shared/models'
7import { environment } from '../../../environments/environment' 8import { environment } from '../../../environments/environment'
8import { RestExtractor, RestPagination, RestService } from '../rest'
9 9
10@Injectable() 10@Injectable()
11export class VideoBlockService { 11export class VideoBlockService {
diff --git a/client/src/app/shared/video/modals/video-report.component.html b/client/src/app/shared/shared-moderation/video-report.component.html
index d6beb6d2a..d6beb6d2a 100644
--- a/client/src/app/shared/video/modals/video-report.component.html
+++ b/client/src/app/shared/shared-moderation/video-report.component.html
diff --git a/client/src/app/shared/video/modals/video-report.component.scss b/client/src/app/shared/shared-moderation/video-report.component.scss
index b2606cbd8..b2606cbd8 100644
--- a/client/src/app/shared/video/modals/video-report.component.scss
+++ b/client/src/app/shared/shared-moderation/video-report.component.scss
diff --git a/client/src/app/shared/video/modals/video-report.component.ts b/client/src/app/shared/shared-moderation/video-report.component.ts
index c2d441bba..11c805636 100644
--- a/client/src/app/shared/video/modals/video-report.component.ts
+++ b/client/src/app/shared/shared-moderation/video-report.component.ts
@@ -1,17 +1,15 @@
1import { mapValues, pickBy } from 'lodash-es'
2import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils'
1import { Component, Input, OnInit, ViewChild } from '@angular/core' 3import { Component, Input, OnInit, ViewChild } from '@angular/core'
4import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
2import { Notifier } from '@app/core' 5import { Notifier } from '@app/core'
3import { FormReactive } from '../../../shared/forms' 6import { FormReactive, FormValidatorService, VideoAbuseValidatorsService } from '@app/shared/shared-forms'
4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
6import { VideoAbuseValidatorsService } from '@app/shared/forms/form-validators/video-abuse-validators.service'
7import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 7import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
8import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref' 8import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap/modal/modal-ref'
9import { VideoAbuseService } from '@app/shared/video-abuse' 9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { Video } from '@app/shared/video/video.model' 10import { videoAbusePredefinedReasonsMap, VideoAbusePredefinedReasonsString } from '@shared/models/videos/abuse/video-abuse-reason.model'
11import { buildVideoEmbed, buildVideoLink } from 'src/assets/player/utils' 11import { Video } from '../shared-main'
12import { DomSanitizer, SafeHtml } from '@angular/platform-browser' 12import { VideoAbuseService } from './video-abuse.service'
13import { VideoAbusePredefinedReasonsString, videoAbusePredefinedReasonsMap } from '@shared/models/videos/abuse/video-abuse-reason.model'
14import { mapValues, pickBy } from 'lodash-es'
15 13
16@Component({ 14@Component({
17 selector: 'my-video-report', 15 selector: 'my-video-report',
diff --git a/client/src/app/shared/shared-thumbnail/index.ts b/client/src/app/shared/shared-thumbnail/index.ts
new file mode 100644
index 000000000..e09692867
--- /dev/null
+++ b/client/src/app/shared/shared-thumbnail/index.ts
@@ -0,0 +1,2 @@
1export * from './video-thumbnail.component'
2export * from './shared-thumbnail.module'
diff --git a/client/src/app/shared/shared-thumbnail/shared-thumbnail.module.ts b/client/src/app/shared/shared-thumbnail/shared-thumbnail.module.ts
new file mode 100644
index 000000000..8ac557c14
--- /dev/null
+++ b/client/src/app/shared/shared-thumbnail/shared-thumbnail.module.ts
@@ -0,0 +1,23 @@
1
2import { NgModule } from '@angular/core'
3import { SharedGlobalIconModule } from '../shared-icons'
4import { SharedMainModule } from '../shared-main/shared-main.module'
5import { VideoThumbnailComponent } from './video-thumbnail.component'
6
7@NgModule({
8 imports: [
9 SharedMainModule,
10 SharedGlobalIconModule
11 ],
12
13 declarations: [
14 VideoThumbnailComponent
15 ],
16
17 exports: [
18 VideoThumbnailComponent
19 ],
20
21 providers: [ ]
22})
23export class SharedThumbnailModule { }
diff --git a/client/src/app/shared/video/video-thumbnail.component.html b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
index fe5510c56..fe5510c56 100644
--- a/client/src/app/shared/video/video-thumbnail.component.html
+++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.html
diff --git a/client/src/app/shared/video/video-thumbnail.component.scss b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss
index feff78a87..feff78a87 100644
--- a/client/src/app/shared/video/video-thumbnail.component.scss
+++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.scss
diff --git a/client/src/app/shared/video/video-thumbnail.component.ts b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
index 111b4c8bb..3ff45d9b7 100644
--- a/client/src/app/shared/video/video-thumbnail.component.ts
+++ b/client/src/app/shared/shared-thumbnail/video-thumbnail.component.ts
@@ -1,7 +1,7 @@
1import { Component, EventEmitter, Input, Output } from '@angular/core' 1import { Component, EventEmitter, Input, Output } from '@angular/core'
2import { Video } from './video.model' 2import { ScreenService } from '@app/core'
3import { ScreenService } from '@app/shared/misc/screen.service'
4import { I18n } from '@ngx-translate/i18n-polyfill' 3import { I18n } from '@ngx-translate/i18n-polyfill'
4import { Video } from '../shared-main'
5 5
6@Component({ 6@Component({
7 selector: 'my-video-thumbnail', 7 selector: 'my-video-thumbnail',
diff --git a/client/src/app/shared/shared-user-settings/index.ts b/client/src/app/shared/shared-user-settings/index.ts
new file mode 100644
index 000000000..dcc08bdce
--- /dev/null
+++ b/client/src/app/shared/shared-user-settings/index.ts
@@ -0,0 +1,4 @@
1export * from './user-interface-settings.component'
2export * from './user-video-settings.component'
3
4export * from './shared-user-settings.module'
diff --git a/client/src/app/shared/shared-user-settings/shared-user-settings.module.ts b/client/src/app/shared/shared-user-settings/shared-user-settings.module.ts
new file mode 100644
index 000000000..395f2e3d0
--- /dev/null
+++ b/client/src/app/shared/shared-user-settings/shared-user-settings.module.ts
@@ -0,0 +1,26 @@
1
2import { NgModule } from '@angular/core'
3import { SharedFormModule } from '../shared-forms'
4import { SharedMainModule } from '../shared-main/shared-main.module'
5import { UserInterfaceSettingsComponent } from './user-interface-settings.component'
6import { UserVideoSettingsComponent } from './user-video-settings.component'
7
8@NgModule({
9 imports: [
10 SharedMainModule,
11 SharedFormModule
12 ],
13
14 declarations: [
15 UserInterfaceSettingsComponent,
16 UserVideoSettingsComponent
17 ],
18
19 exports: [
20 UserInterfaceSettingsComponent,
21 UserVideoSettingsComponent
22 ],
23
24 providers: [ ]
25})
26export class SharedUserInterfaceSettingsModule { }
diff --git a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.html b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html
index 0d0ddc0f2..0d0ddc0f2 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.html
+++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.html
diff --git a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.scss b/client/src/app/shared/shared-user-settings/user-interface-settings.component.scss
index 7818dfc02..7818dfc02 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.scss
+++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.scss
diff --git a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.ts b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
index b6c17c0e3..875ffa3f1 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-interface/my-account-interface-settings.component.ts
+++ b/client/src/app/shared/shared-user-settings/user-interface-settings.component.ts
@@ -1,19 +1,16 @@
1import { Component, Input, OnInit, OnDestroy } from '@angular/core'
2import { Notifier, ServerService } from '@app/core'
3import { ServerConfig, UserUpdateMe } from '../../../../../../shared'
4import { AuthService } from '../../../core'
5import { FormReactive } from '../../../shared/forms/form-reactive'
6import { User, UserService } from '../../../shared/users'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
9import { Subject, Subscription } from 'rxjs' 1import { Subject, Subscription } from 'rxjs'
2import { Component, Input, OnDestroy, OnInit } from '@angular/core'
3import { AuthService, Notifier, ServerService, UserService } from '@app/core'
4import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { ServerConfig, User, UserUpdateMe } from '@shared/models'
10 7
11@Component({ 8@Component({
12 selector: 'my-account-interface-settings', 9 selector: 'my-user-interface-settings',
13 templateUrl: './my-account-interface-settings.component.html', 10 templateUrl: './user-interface-settings.component.html',
14 styleUrls: [ './my-account-interface-settings.component.scss' ] 11 styleUrls: [ './user-interface-settings.component.scss' ]
15}) 12})
16export class MyAccountInterfaceSettingsComponent extends FormReactive implements OnInit, OnDestroy { 13export class UserInterfaceSettingsComponent extends FormReactive implements OnInit, OnDestroy {
17 @Input() user: User = null 14 @Input() user: User = null
18 @Input() reactiveUpdate = false 15 @Input() reactiveUpdate = false
19 @Input() notifyOnUpdate = true 16 @Input() notifyOnUpdate = true
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html b/client/src/app/shared/shared-user-settings/user-video-settings.component.html
index 0dda33af2..0dda33af2 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.html
+++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.html
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.scss b/client/src/app/shared/shared-user-settings/user-video-settings.component.scss
index 430250b87..430250b87 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.scss
+++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.scss
diff --git a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts b/client/src/app/shared/shared-user-settings/user-video-settings.component.ts
index 0aaa54cd7..4e4539936 100644
--- a/client/src/app/+my-account/my-account-settings/my-account-video-settings/my-account-video-settings.component.ts
+++ b/client/src/app/shared/shared-user-settings/user-video-settings.component.ts
@@ -1,23 +1,20 @@
1import { Component, Input, OnInit, OnDestroy } from '@angular/core' 1import { pick } from 'lodash-es'
2import { Notifier, ServerService } from '@app/core'
3import { UserUpdateMe } from '../../../../../../shared/models/users'
4import { User, UserService } from '@app/shared/users'
5import { AuthService } from '../../../core'
6import { FormReactive } from '@app/shared/forms/form-reactive'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
9import { forkJoin, Subject, Subscription } from 'rxjs'
10import { SelectItem } from 'primeng/api' 2import { SelectItem } from 'primeng/api'
3import { forkJoin, Subject, Subscription } from 'rxjs'
11import { first } from 'rxjs/operators' 4import { first } from 'rxjs/operators'
5import { Component, Input, OnDestroy, OnInit } from '@angular/core'
6import { AuthService, Notifier, ServerService, User, UserService } from '@app/core'
7import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { UserUpdateMe } from '@shared/models'
12import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type' 10import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type'
13import { pick } from 'lodash-es'
14 11
15@Component({ 12@Component({
16 selector: 'my-account-video-settings', 13 selector: 'my-user-video-settings',
17 templateUrl: './my-account-video-settings.component.html', 14 templateUrl: './user-video-settings.component.html',
18 styleUrls: [ './my-account-video-settings.component.scss' ] 15 styleUrls: [ './user-video-settings.component.scss' ]
19}) 16})
20export class MyAccountVideoSettingsComponent extends FormReactive implements OnInit, OnDestroy { 17export class UserVideoSettingsComponent extends FormReactive implements OnInit, OnDestroy {
21 @Input() user: User = null 18 @Input() user: User = null
22 @Input() reactiveUpdate = false 19 @Input() reactiveUpdate = false
23 @Input() notifyOnUpdate = true 20 @Input() notifyOnUpdate = true
diff --git a/client/src/app/shared/user-subscription/index.ts b/client/src/app/shared/shared-user-subscription/index.ts
index e76940f7b..fd53d14b5 100644
--- a/client/src/app/shared/user-subscription/index.ts
+++ b/client/src/app/shared/shared-user-subscription/index.ts
@@ -1,3 +1,5 @@
1export * from './user-subscription.service' 1export * from './user-subscription.service'
2export * from './subscribe-button.component' 2export * from './subscribe-button.component'
3export * from './remote-subscribe.component' 3export * from './remote-subscribe.component'
4
5export * from './shared-user-subscription.module'
diff --git a/client/src/app/shared/user-subscription/remote-subscribe.component.html b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.html
index acfec0a8e..acfec0a8e 100644
--- a/client/src/app/shared/user-subscription/remote-subscribe.component.html
+++ b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.html
diff --git a/client/src/app/shared/user-subscription/remote-subscribe.component.scss b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.scss
index 698c5866a..698c5866a 100644
--- a/client/src/app/shared/user-subscription/remote-subscribe.component.scss
+++ b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.scss
diff --git a/client/src/app/shared/user-subscription/remote-subscribe.component.ts b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts
index befdb7157..09164a5d3 100644
--- a/client/src/app/shared/user-subscription/remote-subscribe.component.ts
+++ b/client/src/app/shared/shared-user-subscription/remote-subscribe.component.ts
@@ -1,9 +1,5 @@
1import { Component, Input, OnInit } from '@angular/core' 1import { Component, Input, OnInit } from '@angular/core'
2import { FormReactive } from '@app/shared/forms/form-reactive' 2import { FormReactive, FormValidatorService, UserValidatorsService } from '@app/shared/shared-forms'
3import {
4 FormValidatorService,
5 UserValidatorsService
6} from '@app/shared/forms/form-validators'
7 3
8@Component({ 4@Component({
9 selector: 'my-remote-subscribe', 5 selector: 'my-remote-subscribe',
diff --git a/client/src/app/shared/shared-user-subscription/shared-user-subscription.module.ts b/client/src/app/shared/shared-user-subscription/shared-user-subscription.module.ts
new file mode 100644
index 000000000..cddea80bf
--- /dev/null
+++ b/client/src/app/shared/shared-user-subscription/shared-user-subscription.module.ts
@@ -0,0 +1,29 @@
1
2import { NgModule } from '@angular/core'
3import { SharedFormModule } from '../shared-forms'
4import { SharedMainModule } from '../shared-main/shared-main.module'
5import { RemoteSubscribeComponent } from './remote-subscribe.component'
6import { SubscribeButtonComponent } from './subscribe-button.component'
7import { UserSubscriptionService } from './user-subscription.service'
8
9@NgModule({
10 imports: [
11 SharedMainModule,
12 SharedFormModule
13 ],
14
15 declarations: [
16 RemoteSubscribeComponent,
17 SubscribeButtonComponent
18 ],
19
20 exports: [
21 RemoteSubscribeComponent,
22 SubscribeButtonComponent
23 ],
24
25 providers: [
26 UserSubscriptionService
27 ]
28})
29export class SharedUserSubscriptionModule { }
diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.html b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html
index 85b3d1fdb..85b3d1fdb 100644
--- a/client/src/app/shared/user-subscription/subscribe-button.component.html
+++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.html
diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.scss b/client/src/app/shared/shared-user-subscription/subscribe-button.component.scss
index b739c5ae2..b739c5ae2 100644
--- a/client/src/app/shared/user-subscription/subscribe-button.component.scss
+++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.scss
diff --git a/client/src/app/shared/user-subscription/subscribe-button.component.ts b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
index 947f34c85..72fa3f4fd 100644
--- a/client/src/app/shared/user-subscription/subscribe-button.component.ts
+++ b/client/src/app/shared/shared-user-subscription/subscribe-button.component.ts
@@ -1,13 +1,11 @@
1import { Component, Input, OnInit, OnChanges } from '@angular/core' 1import { concat, forkJoin, merge } from 'rxjs'
2import { Component, Input, OnChanges, OnInit } from '@angular/core'
2import { Router } from '@angular/router' 3import { Router } from '@angular/router'
3import { AuthService, Notifier } from '@app/core' 4import { AuthService, Notifier } from '@app/core'
4import { UserSubscriptionService } from '@app/shared/user-subscription/user-subscription.service' 5import { Account, VideoChannel, VideoService } from '@app/shared/shared-main'
5import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
6import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { VideoService } from '@app/shared/video/video.service' 7import { FeedFormat } from '@shared/models'
8import { FeedFormat } from '../../../../../shared/models/feeds' 8import { UserSubscriptionService } from './user-subscription.service'
9import { Account } from '@app/shared/account/account.model'
10import { concat, forkJoin, merge } from 'rxjs'
11 9
12@Component({ 10@Component({
13 selector: 'my-subscribe-button', 11 selector: 'my-subscribe-button',
diff --git a/client/src/app/shared/user-subscription/user-subscription.service.ts b/client/src/app/shared/shared-user-subscription/user-subscription.service.ts
index 9af9ba23e..732ed6bcb 100644
--- a/client/src/app/shared/user-subscription/user-subscription.service.ts
+++ b/client/src/app/shared/shared-user-subscription/user-subscription.service.ts
@@ -1,17 +1,14 @@
1import { bufferTime, catchError, filter, map, observeOn, share, switchMap, tap } from 'rxjs/operators' 1import * as debug from 'debug'
2import { uniq } from 'lodash-es'
2import { asyncScheduler, merge, Observable, of, ReplaySubject, Subject } from 'rxjs' 3import { asyncScheduler, merge, Observable, of, ReplaySubject, Subject } from 'rxjs'
4import { bufferTime, catchError, filter, map, observeOn, share, switchMap, tap } from 'rxjs/operators'
3import { HttpClient, HttpParams } from '@angular/common/http' 5import { HttpClient, HttpParams } from '@angular/common/http'
4import { Injectable, NgZone } from '@angular/core' 6import { Injectable, NgZone } from '@angular/core'
5import { ResultList } from '../../../../../shared' 7import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core'
8import { enterZone, leaveZone } from '@app/helpers'
9import { Video, VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main'
10import { ResultList, VideoChannel as VideoChannelServer, VideoSortField } from '@shared/models'
6import { environment } from '../../../environments/environment' 11import { environment } from '../../../environments/environment'
7import { RestExtractor, RestService } from '../rest'
8import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
9import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
10import { VideoChannel as VideoChannelServer } from '../../../../../shared/models/videos'
11import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model'
12import { uniq } from 'lodash-es'
13import * as debug from 'debug'
14import { enterZone, leaveZone } from '@app/shared/rxjs/zone'
15 12
16const logger = debug('peertube:subscriptions:UserSubscriptionService') 13const logger = debug('peertube:subscriptions:UserSubscriptionService')
17 14
@@ -33,6 +30,7 @@ export class UserSubscriptionService {
33 constructor ( 30 constructor (
34 private authHttp: HttpClient, 31 private authHttp: HttpClient,
35 private restExtractor: RestExtractor, 32 private restExtractor: RestExtractor,
33 private videoService: VideoService,
36 private restService: RestService, 34 private restService: RestService,
37 private ngZone: NgZone 35 private ngZone: NgZone
38 ) { 36 ) {
@@ -51,6 +49,27 @@ export class UserSubscriptionService {
51 ) 49 )
52 } 50 }
53 51
52 getUserSubscriptionVideos (parameters: {
53 videoPagination: ComponentPaginationLight,
54 sort: VideoSortField,
55 skipCount?: boolean
56 }): Observable<ResultList<Video>> {
57 const { videoPagination, sort, skipCount } = parameters
58 const pagination = this.restService.componentPaginationToRestPagination(videoPagination)
59
60 let params = new HttpParams()
61 params = this.restService.addRestGetParams(params, pagination, sort)
62
63 if (skipCount) params = params.set('skipCount', skipCount + '')
64
65 return this.authHttp
66 .get<ResultList<Video>>(UserSubscriptionService.BASE_USER_SUBSCRIPTIONS_URL + '/videos', { params })
67 .pipe(
68 switchMap(res => this.videoService.extractVideos(res)),
69 catchError(err => this.restExtractor.handleError(err))
70 )
71 }
72
54 /** 73 /**
55 * Subscription part 74 * Subscription part
56 */ 75 */
diff --git a/client/src/app/shared/video/abstract-video-list.html b/client/src/app/shared/shared-video-miniature/abstract-video-list.html
index 1e919ee72..1e919ee72 100644
--- a/client/src/app/shared/video/abstract-video-list.html
+++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.html
diff --git a/client/src/app/shared/video/abstract-video-list.scss b/client/src/app/shared/shared-video-miniature/abstract-video-list.scss
index 7f23098aa..7f23098aa 100644
--- a/client/src/app/shared/video/abstract-video-list.scss
+++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.scss
diff --git a/client/src/app/shared/video/abstract-video-list.ts b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts
index 0bc339ff6..0ef842652 100644
--- a/client/src/app/shared/video/abstract-video-list.ts
+++ b/client/src/app/shared/shared-video-miniature/abstract-video-list.ts
@@ -1,23 +1,25 @@
1import { fromEvent, Observable, of, Subject, Subscription } from 'rxjs' 1import { fromEvent, Observable, Subject, Subscription } from 'rxjs'
2import { debounceTime, tap, throttleTime, switchMap } from 'rxjs/operators' 2import { debounceTime, switchMap, tap } from 'rxjs/operators'
3import { OnDestroy, OnInit } from '@angular/core' 3import { OnDestroy, OnInit } from '@angular/core'
4import { ActivatedRoute, Router } from '@angular/router' 4import { ActivatedRoute, Router } from '@angular/router'
5import { Notifier, ServerService } from '@app/core' 5import {
6 AuthService,
7 ComponentPaginationLight,
8 LocalStorageService,
9 Notifier,
10 ScreenService,
11 ServerService,
12 User,
13 UserService
14} from '@app/core'
6import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook' 15import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
7import { GlobalIconName } from '@app/shared/images/global-icon.component' 16import { GlobalIconName } from '@app/shared/shared-icons'
8import { ScreenService } from '@app/shared/misc/screen.service'
9import { Syndication } from '@app/shared/video/syndication.model'
10import { MiniatureDisplayOptions, OwnerDisplayType } from '@app/shared/video/video-miniature.component'
11import { I18n } from '@ngx-translate/i18n-polyfill' 17import { I18n } from '@ngx-translate/i18n-polyfill'
12import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date' 18import { isLastMonth, isLastWeek, isToday, isYesterday } from '@shared/core-utils/miscs/date'
13import { ServerConfig } from '@shared/models' 19import { ServerConfig, VideoSortField } from '@shared/models'
14import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type' 20import { NSFWPolicyType } from '@shared/models/videos/nsfw-policy.type'
15import { AuthService } from '../../core/auth' 21import { Syndication, Video } from '../shared-main'
16import { LocalStorageService } from '../misc/storage.service' 22import { MiniatureDisplayOptions, OwnerDisplayType } from './video-miniature.component'
17import { ComponentPaginationLight } from '../rest/component-pagination.model'
18import { User, UserService } from '../users'
19import { VideoSortField } from './sort-field.type'
20import { Video } from './video.model'
21 23
22enum GroupDate { 24enum GroupDate {
23 UNKNOWN = 0, 25 UNKNOWN = 0,
diff --git a/client/src/app/shared/shared-video-miniature/index.ts b/client/src/app/shared/shared-video-miniature/index.ts
new file mode 100644
index 000000000..47ca6f51b
--- /dev/null
+++ b/client/src/app/shared/shared-video-miniature/index.ts
@@ -0,0 +1,7 @@
1export * from './abstract-video-list'
2export * from './video-actions-dropdown.component'
3export * from './video-download.component'
4export * from './video-miniature.component'
5export * from './videos-selection.component'
6
7export * from './shared-video-miniature.module'
diff --git a/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts
new file mode 100644
index 000000000..666144864
--- /dev/null
+++ b/client/src/app/shared/shared-video-miniature/shared-video-miniature.module.ts
@@ -0,0 +1,40 @@
1
2import { NgModule } from '@angular/core'
3import { SharedFormModule } from '../shared-forms'
4import { SharedGlobalIconModule } from '../shared-icons'
5import { SharedMainModule } from '../shared-main/shared-main.module'
6import { SharedModerationModule } from '../shared-moderation'
7import { SharedThumbnailModule } from '../shared-thumbnail'
8import { SharedVideoPlaylistModule } from '../shared-video-playlist/shared-video-playlist.module'
9import { VideoActionsDropdownComponent } from './video-actions-dropdown.component'
10import { VideoDownloadComponent } from './video-download.component'
11import { VideoMiniatureComponent } from './video-miniature.component'
12import { VideosSelectionComponent } from './videos-selection.component'
13
14@NgModule({
15 imports: [
16 SharedMainModule,
17 SharedFormModule,
18 SharedModerationModule,
19 SharedVideoPlaylistModule,
20 SharedThumbnailModule,
21 SharedGlobalIconModule
22 ],
23
24 declarations: [
25 VideoActionsDropdownComponent,
26 VideoDownloadComponent,
27 VideoMiniatureComponent,
28 VideosSelectionComponent
29 ],
30
31 exports: [
32 VideoActionsDropdownComponent,
33 VideoDownloadComponent,
34 VideoMiniatureComponent,
35 VideosSelectionComponent
36 ],
37
38 providers: [ ]
39})
40export class SharedVideoMiniatureModule { }
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.html b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html
index 3c8271b65..3c8271b65 100644
--- a/client/src/app/shared/video/video-actions-dropdown.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.html
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.scss b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.scss
index 67d7ee86a..67d7ee86a 100644
--- a/client/src/app/shared/video/video-actions-dropdown.component.scss
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.scss
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
index 1f5763610..db8d1c309 100644
--- a/client/src/app/shared/video/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-actions-dropdown.component.ts
@@ -1,19 +1,12 @@
1import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' 1import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'
2import { I18n } from '@ngx-translate/i18n-polyfill' 2import { AuthService, ConfirmService, Notifier, ScreenService } from '@app/core'
3import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component' 3import { VideoBlockComponent, VideoBlockService, VideoReportComponent } from '@app/shared/shared-moderation'
4import { AuthService, ConfirmService, Notifier } from '@app/core'
5import { Video } from '@app/shared/video/video.model'
6import { VideoService } from '@app/shared/video/video.service'
7import { VideoDetails } from '@app/shared/video/video-details.model'
8import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' 4import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'
9import { VideoAddToPlaylistComponent } from '@app/shared/video-playlist/video-add-to-playlist.component' 5import { I18n } from '@ngx-translate/i18n-polyfill'
10import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component'
11import { VideoReportComponent } from '@app/shared/video/modals/video-report.component'
12import { VideoBlockComponent } from '@app/shared/video/modals/video-block.component'
13import { VideoBlockService } from '@app/shared/video-block'
14import { ScreenService } from '@app/shared/misc/screen.service'
15import { VideoCaption } from '@shared/models' 6import { VideoCaption } from '@shared/models'
16import { RedundancyService } from '@app/shared/video/redundancy.service' 7import { DropdownAction, DropdownButtonSize, DropdownDirection, RedundancyService, Video, VideoDetails, VideoService } from '../shared-main'
8import { VideoAddToPlaylistComponent } from '../shared-video-playlist'
9import { VideoDownloadComponent } from './video-download.component'
17 10
18export type VideoActionsDisplayType = { 11export type VideoActionsDisplayType = {
19 playlist?: boolean 12 playlist?: boolean
diff --git a/client/src/app/shared/video/modals/video-download.component.html b/client/src/app/shared/shared-video-miniature/video-download.component.html
index c65e371ee..c65e371ee 100644
--- a/client/src/app/shared/video/modals/video-download.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-download.component.html
diff --git a/client/src/app/shared/video/modals/video-download.component.scss b/client/src/app/shared/shared-video-miniature/video-download.component.scss
index b09078bea..b09078bea 100644
--- a/client/src/app/shared/video/modals/video-download.component.scss
+++ b/client/src/app/shared/shared-video-miniature/video-download.component.scss
diff --git a/client/src/app/shared/video/modals/video-download.component.ts b/client/src/app/shared/shared-video-miniature/video-download.component.ts
index d77187821..21df8b674 100644
--- a/client/src/app/shared/video/modals/video-download.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-download.component.ts
@@ -1,14 +1,12 @@
1import { Component, ElementRef, ViewChild } from '@angular/core'
2import { VideoDetails } from '../../../shared/video/video-details.model'
3import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { I18n } from '@ngx-translate/i18n-polyfill'
5import { AuthService, Notifier } from '@app/core'
6import { VideoPrivacy, VideoCaption, VideoFile } from '@shared/models'
7import { FfprobeFormat, FfprobeStream } from 'fluent-ffmpeg' 1import { FfprobeFormat, FfprobeStream } from 'fluent-ffmpeg'
8import { mapValues, pick } from 'lodash-es' 2import { mapValues, pick } from 'lodash-es'
9import { NumberFormatterPipe } from '@app/shared/angular/number-formatter.pipe'
10import { BytesPipe } from 'ngx-pipes' 3import { BytesPipe } from 'ngx-pipes'
11import { VideoService } from '../video.service' 4import { Component, ElementRef, ViewChild } from '@angular/core'
5import { AuthService, Notifier } from '@app/core'
6import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'
7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { VideoCaption, VideoFile, VideoPrivacy } from '@shared/models'
9import { NumberFormatterPipe, VideoDetails, VideoService } from '../shared-main'
12 10
13type DownloadType = 'video' | 'subtitles' 11type DownloadType = 'video' | 'subtitles'
14type FileMetadata = { [key: string]: { label: string, value: string }} 12type FileMetadata = { [key: string]: { label: string, value: string }}
diff --git a/client/src/app/shared/video/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
index 82afc866f..82afc866f 100644
--- a/client/src/app/shared/video/video-miniature.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
diff --git a/client/src/app/shared/video/video-miniature.component.scss b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
index 38cac5b6e..38cac5b6e 100644
--- a/client/src/app/shared/video/video-miniature.component.scss
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.scss
diff --git a/client/src/app/shared/video/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
index a08c3fc8d..6f32977b3 100644
--- a/client/src/app/shared/video/video-miniature.component.ts
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts
@@ -10,14 +10,12 @@ import {
10 OnInit, 10 OnInit,
11 Output 11 Output
12} from '@angular/core' 12} from '@angular/core'
13import { AuthService, ServerService } from '@app/core' 13import { AuthService, ScreenService, ServerService, User } from '@app/core'
14import { ScreenService } from '@app/shared/misc/screen.service'
15import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
16import { VideoActionsDisplayType } from '@app/shared/video/video-actions-dropdown.component'
17import { I18n } from '@ngx-translate/i18n-polyfill' 14import { I18n } from '@ngx-translate/i18n-polyfill'
18import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '../../../../../shared' 15import { ServerConfig, VideoPlaylistType, VideoPrivacy, VideoState } from '../../../../../shared'
19import { User } from '../users' 16import { Video } from '../shared-main'
20import { Video } from './video.model' 17import { VideoPlaylistService } from '../shared-video-playlist'
18import { VideoActionsDisplayType } from './video-actions-dropdown.component'
21 19
22export type OwnerDisplayType = 'account' | 'videoChannel' | 'auto' 20export type OwnerDisplayType = 'account' | 'videoChannel' | 'auto'
23export type MiniatureDisplayOptions = { 21export type MiniatureDisplayOptions = {
diff --git a/client/src/app/shared/video/videos-selection.component.html b/client/src/app/shared/shared-video-miniature/videos-selection.component.html
index 44aa567b9..44aa567b9 100644
--- a/client/src/app/shared/video/videos-selection.component.html
+++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.html
diff --git a/client/src/app/shared/video/videos-selection.component.scss b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss
index d3cbabf23..d3cbabf23 100644
--- a/client/src/app/shared/video/videos-selection.component.scss
+++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.scss
diff --git a/client/src/app/shared/video/videos-selection.component.ts b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts
index 9453664dd..3e0e3b983 100644
--- a/client/src/app/shared/video/videos-selection.component.ts
+++ b/client/src/app/shared/shared-video-miniature/videos-selection.component.ts
@@ -1,3 +1,4 @@
1import { Observable } from 'rxjs'
1import { 2import {
2 AfterContentInit, 3 AfterContentInit,
3 Component, 4 Component,
@@ -11,19 +12,12 @@ import {
11 TemplateRef 12 TemplateRef
12} from '@angular/core' 13} from '@angular/core'
13import { ActivatedRoute, Router } from '@angular/router' 14import { ActivatedRoute, Router } from '@angular/router'
14import { AbstractVideoList } from '@app/shared/video/abstract-video-list' 15import { AuthService, ComponentPagination, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
15import { AuthService, Notifier, ServerService } from '@app/core'
16import { ScreenService } from '@app/shared/misc/screen.service'
17import { MiniatureDisplayOptions, OwnerDisplayType } from '@app/shared/video/video-miniature.component'
18import { Observable } from 'rxjs'
19import { Video } from '@app/shared/video/video.model'
20import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive'
21import { VideoSortField } from '@app/shared/video/sort-field.type'
22import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
23import { I18n } from '@ngx-translate/i18n-polyfill' 16import { I18n } from '@ngx-translate/i18n-polyfill'
24import { ResultList } from '@shared/models' 17import { ResultList, VideoSortField } from '@shared/models'
25import { UserService } from '../users' 18import { PeerTubeTemplateDirective, Video } from '../shared-main'
26import { LocalStorageService } from '../misc/storage.service' 19import { AbstractVideoList } from './abstract-video-list'
20import { MiniatureDisplayOptions, OwnerDisplayType } from './video-miniature.component'
27 21
28export type SelectionType = { [ id: number ]: boolean } 22export type SelectionType = { [ id: number ]: boolean }
29 23
diff --git a/client/src/app/shared/shared-video-playlist/index.ts b/client/src/app/shared/shared-video-playlist/index.ts
new file mode 100644
index 000000000..63bb046c6
--- /dev/null
+++ b/client/src/app/shared/shared-video-playlist/index.ts
@@ -0,0 +1,8 @@
1export * from './video-add-to-playlist.component'
2export * from './video-playlist-element-miniature.component'
3export * from './video-playlist-element.model'
4export * from './video-playlist-miniature.component'
5export * from './video-playlist.model'
6export * from './video-playlist.service'
7
8export * from './shared-video-playlist.module'
diff --git a/client/src/app/shared/shared-video-playlist/shared-video-playlist.module.ts b/client/src/app/shared/shared-video-playlist/shared-video-playlist.module.ts
new file mode 100644
index 000000000..0566b1592
--- /dev/null
+++ b/client/src/app/shared/shared-video-playlist/shared-video-playlist.module.ts
@@ -0,0 +1,36 @@
1
2import { NgModule } from '@angular/core'
3import { SharedFormModule } from '../shared-forms'
4import { SharedGlobalIconModule } from '../shared-icons'
5import { SharedMainModule } from '../shared-main/shared-main.module'
6import { SharedThumbnailModule } from '../shared-thumbnail'
7import { VideoAddToPlaylistComponent } from './video-add-to-playlist.component'
8import { VideoPlaylistElementMiniatureComponent } from './video-playlist-element-miniature.component'
9import { VideoPlaylistMiniatureComponent } from './video-playlist-miniature.component'
10import { VideoPlaylistService } from './video-playlist.service'
11
12@NgModule({
13 imports: [
14 SharedMainModule,
15 SharedFormModule,
16 SharedThumbnailModule,
17 SharedGlobalIconModule
18 ],
19
20 declarations: [
21 VideoAddToPlaylistComponent,
22 VideoPlaylistElementMiniatureComponent,
23 VideoPlaylistMiniatureComponent
24 ],
25
26 exports: [
27 VideoAddToPlaylistComponent,
28 VideoPlaylistElementMiniatureComponent,
29 VideoPlaylistMiniatureComponent
30 ],
31
32 providers: [
33 VideoPlaylistService
34 ]
35})
36export class SharedVideoPlaylistModule { }
diff --git a/client/src/app/shared/video-playlist/video-add-to-playlist.component.html b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html
index a40e0699e..a40e0699e 100644
--- a/client/src/app/shared/video-playlist/video-add-to-playlist.component.html
+++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html
diff --git a/client/src/app/shared/video-playlist/video-add-to-playlist.component.scss b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.scss
index 47baa997b..47baa997b 100644
--- a/client/src/app/shared/video-playlist/video-add-to-playlist.component.scss
+++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.scss
diff --git a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts
index 0c593a79a..f611fc46b 100644
--- a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts
+++ b/client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.ts
@@ -1,15 +1,13 @@
1import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core' 1import * as debug from 'debug'
2import { CachedPlaylist, VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
3import { AuthService, Notifier } from '@app/core'
4import { Subject, Subscription } from 'rxjs' 2import { Subject, Subscription } from 'rxjs'
5import { debounceTime, filter } from 'rxjs/operators' 3import { debounceTime, filter } from 'rxjs/operators'
6import { Video, VideoPlaylistCreate, VideoPlaylistElementCreate, VideoPlaylistPrivacy } from '@shared/models' 4import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'
7import { FormReactive, FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/forms' 5import { AuthService, DisableForReuseHook, Notifier } from '@app/core'
6import { FormReactive, FormValidatorService, VideoPlaylistValidatorsService } from '@app/shared/shared-forms'
8import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { Video, VideoExistInPlaylist, VideoPlaylistCreate, VideoPlaylistElementCreate, VideoPlaylistPrivacy } from '@shared/models'
9import { secondsToTime } from '../../../assets/player/utils' 9import { secondsToTime } from '../../../assets/player/utils'
10import * as debug from 'debug' 10import { CachedPlaylist, VideoPlaylistService } from './video-playlist.service'
11import { DisableForReuseHook } from '@app/core/routing/disable-for-reuse-hook'
12import { VideoExistInPlaylist } from '@shared/models/videos/playlist/video-exist-in-playlist.model'
13 11
14const logger = debug('peertube:playlists:VideoAddToPlaylistComponent') 12const logger = debug('peertube:playlists:VideoAddToPlaylistComponent')
15 13
diff --git a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html
index e3f7ef017..e3f7ef017 100644
--- a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.html
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.html
diff --git a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.scss b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss
index afd775b25..afd775b25 100644
--- a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.scss
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.scss
diff --git a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts
index fad03e045..57a5fbe61 100644
--- a/client/src/app/shared/video-playlist/video-playlist-element-miniature.component.ts
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element-miniature.component.ts
@@ -1,15 +1,13 @@
1import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' 1import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
2import { Video } from '@app/shared/video/video.model' 2import { AuthService, Notifier, ServerService } from '@app/core'
3import { ServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate } from '@shared/models' 3import { Video } from '@app/shared/shared-main'
4import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core'
5import { ActivatedRoute } from '@angular/router'
6import { I18n } from '@ngx-translate/i18n-polyfill'
7import { VideoService } from '@app/shared/video/video.service'
8import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
9import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap' 4import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'
10import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' 5import { I18n } from '@ngx-translate/i18n-polyfill'
6import { ServerConfig, VideoPlaylistElementType, VideoPlaylistElementUpdate } from '@shared/models'
11import { secondsToTime } from '../../../assets/player/utils' 7import { secondsToTime } from '../../../assets/player/utils'
12import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model' 8import { VideoPlaylistElement } from './video-playlist-element.model'
9import { VideoPlaylist } from './video-playlist.model'
10import { VideoPlaylistService } from './video-playlist.service'
13 11
14@Component({ 12@Component({
15 selector: 'my-video-playlist-element-miniature', 13 selector: 'my-video-playlist-element-miniature',
@@ -46,10 +44,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit {
46 private authService: AuthService, 44 private authService: AuthService,
47 private serverService: ServerService, 45 private serverService: ServerService,
48 private notifier: Notifier, 46 private notifier: Notifier,
49 private confirmService: ConfirmService,
50 private route: ActivatedRoute,
51 private i18n: I18n, 47 private i18n: I18n,
52 private videoService: VideoService,
53 private videoPlaylistService: VideoPlaylistService, 48 private videoPlaylistService: VideoPlaylistService,
54 private cdr: ChangeDetectorRef 49 private cdr: ChangeDetectorRef
55 ) {} 50 ) {}
diff --git a/client/src/app/shared/video-playlist/video-playlist-element.model.ts b/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts
index f1c46d1eb..27a79d1fd 100644
--- a/client/src/app/shared/video-playlist/video-playlist-element.model.ts
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts
@@ -1,5 +1,5 @@
1import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '../../../../../shared/models/videos' 1import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '../../../../../shared/models/videos'
2import { Video } from '@app/shared/video/video.model' 2import { Video } from '@app/shared/shared-main'
3 3
4export class VideoPlaylistElement implements ServerVideoPlaylistElement { 4export class VideoPlaylistElement implements ServerVideoPlaylistElement {
5 id: number 5 id: number
diff --git a/client/src/app/shared/video-playlist/video-playlist-miniature.component.html b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html
index 86f6664cb..86f6664cb 100644
--- a/client/src/app/shared/video-playlist/video-playlist-miniature.component.html
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.html
diff --git a/client/src/app/shared/video-playlist/video-playlist-miniature.component.scss b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.scss
index 1b16dbb01..1b16dbb01 100644
--- a/client/src/app/shared/video-playlist/video-playlist-miniature.component.scss
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.scss
diff --git a/client/src/app/shared/video-playlist/video-playlist-miniature.component.ts b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts
index 523e96f2a..4b0669a32 100644
--- a/client/src/app/shared/video-playlist/video-playlist-miniature.component.ts
+++ b/client/src/app/shared/shared-video-playlist/video-playlist-miniature.component.ts
@@ -1,5 +1,5 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' 2import { VideoPlaylist } from './video-playlist.model'
3 3
4@Component({ 4@Component({
5 selector: 'my-video-playlist-miniature', 5 selector: 'my-video-playlist-miniature',
diff --git a/client/src/app/shared/video-playlist/video-playlist.model.ts b/client/src/app/shared/shared-video-playlist/video-playlist.model.ts
index 6f27e7475..8f63d2abd 100644
--- a/client/src/app/shared/video-playlist/video-playlist.model.ts
+++ b/client/src/app/shared/shared-video-playlist/video-playlist.model.ts
@@ -1,13 +1,14 @@
1import { getAbsoluteAPIUrl } from '@app/helpers'
2import { Actor } from '@app/shared/shared-main'
1import { 3import {
4 AccountSummary,
5 peertubeTranslate,
2 VideoChannelSummary, 6 VideoChannelSummary,
3 VideoConstant, 7 VideoConstant,
4 VideoPlaylist as ServerVideoPlaylist, 8 VideoPlaylist as ServerVideoPlaylist,
5 VideoPlaylistPrivacy, 9 VideoPlaylistPrivacy,
6 VideoPlaylistType 10 VideoPlaylistType
7} from '../../../../../shared/models/videos' 11} from '@shared/models'
8import { AccountSummary, peertubeTranslate } from '@shared/models'
9import { Actor } from '@app/shared/actor/actor.model'
10import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'
11 12
12export class VideoPlaylist implements ServerVideoPlaylist { 13export class VideoPlaylist implements ServerVideoPlaylist {
13 id: number 14 id: number
diff --git a/client/src/app/shared/video-playlist/video-playlist.service.ts b/client/src/app/shared/shared-video-playlist/video-playlist.service.ts
index 38d915c6b..cc3d04b9e 100644
--- a/client/src/app/shared/video-playlist/video-playlist.service.ts
+++ b/client/src/app/shared/shared-video-playlist/video-playlist.service.ts
@@ -1,29 +1,27 @@
1import { bufferTime, catchError, filter, map, observeOn, share, switchMap, tap } from 'rxjs/operators' 1import * as debug from 'debug'
2import { Injectable, NgZone } from '@angular/core' 2import { uniq } from 'lodash-es'
3import { asyncScheduler, merge, Observable, of, ReplaySubject, Subject } from 'rxjs' 3import { asyncScheduler, merge, Observable, of, ReplaySubject, Subject } from 'rxjs'
4import { RestExtractor } from '../rest/rest-extractor.service' 4import { bufferTime, catchError, filter, map, observeOn, share, switchMap, tap } from 'rxjs/operators'
5import { HttpClient, HttpParams } from '@angular/common/http' 5import { HttpClient, HttpParams } from '@angular/common/http'
6import { ResultList, VideoPlaylistElementCreate, VideoPlaylistElementUpdate } from '../../../../../shared' 6import { Injectable, NgZone } from '@angular/core'
7import { AuthUser, ComponentPaginationLight, RestExtractor, RestService, ServerService } from '@app/core'
8import { enterZone, leaveZone, objectToFormData } from '@app/helpers'
9import { Account, AccountService, VideoChannel, VideoChannelService } from '@app/shared/shared-main'
10import {
11 ResultList,
12 VideoExistInPlaylist,
13 VideoPlaylist as VideoPlaylistServerModel,
14 VideoPlaylistCreate,
15 VideoPlaylistElement as ServerVideoPlaylistElement,
16 VideoPlaylistElementCreate,
17 VideoPlaylistElementUpdate,
18 VideoPlaylistReorder,
19 VideoPlaylistUpdate,
20 VideosExistInPlaylists
21} from '@shared/models'
7import { environment } from '../../../environments/environment' 22import { environment } from '../../../environments/environment'
8import { VideoPlaylist as VideoPlaylistServerModel } from '@shared/models/videos/playlist/video-playlist.model' 23import { VideoPlaylistElement } from './video-playlist-element.model'
9import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' 24import { VideoPlaylist } from './video-playlist.model'
10import { VideoChannel } from '@app/shared/video-channel/video-channel.model'
11import { VideoPlaylistCreate } from '@shared/models/videos/playlist/video-playlist-create.model'
12import { VideoPlaylistUpdate } from '@shared/models/videos/playlist/video-playlist-update.model'
13import { objectToFormData } from '@app/shared/misc/utils'
14import { AuthUser, ServerService } from '@app/core'
15import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
16import { AccountService } from '@app/shared/account/account.service'
17import { Account } from '@app/shared/account/account.model'
18import { RestService } from '@app/shared/rest'
19import { VideoExistInPlaylist, VideosExistInPlaylists } from '@shared/models/videos/playlist/video-exist-in-playlist.model'
20import { VideoPlaylistReorder } from '@shared/models/videos/playlist/video-playlist-reorder.model'
21import { ComponentPaginationLight } from '@app/shared/rest/component-pagination.model'
22import { VideoPlaylistElement as ServerVideoPlaylistElement } from '@shared/models/videos/playlist/video-playlist-element.model'
23import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model'
24import { uniq } from 'lodash-es'
25import * as debug from 'debug'
26import { enterZone, leaveZone } from '@app/shared/rxjs/zone'
27 25
28const logger = debug('peertube:playlists:VideoPlaylistService') 26const logger = debug('peertube:playlists:VideoPlaylistService')
29 27
diff --git a/client/src/app/shared/shared.module.ts b/client/src/app/shared/shared.module.ts
deleted file mode 100644
index 98fab9e16..000000000
--- a/client/src/app/shared/shared.module.ts
+++ /dev/null
@@ -1,337 +0,0 @@
1import { BytesPipe, KeysPipe, NgPipesModule } from 'ngx-pipes'
2import { SharedModule as PrimeSharedModule } from 'primeng/api'
3import { InputMaskModule } from 'primeng/inputmask'
4import { InputSwitchModule } from 'primeng/inputswitch'
5import { MultiSelectModule } from 'primeng/multiselect'
6import { ClipboardModule } from '@angular/cdk/clipboard'
7import { CommonModule } from '@angular/common'
8import { HttpClientModule } from '@angular/common/http'
9import { NgModule } from '@angular/core'
10import { FormsModule, ReactiveFormsModule } from '@angular/forms'
11import { RouterModule } from '@angular/router'
12import { BatchDomainsValidatorsService } from '@app/+admin/config/shared/batch-domains-validators.service'
13import { BatchDomainsModalComponent } from '@app/+admin/config/shared/batch-domains-modal.component'
14import { MyAccountInterfaceSettingsComponent } from '@app/+my-account/my-account-settings/my-account-interface'
15import { MyAccountVideoSettingsComponent } from '@app/+my-account/my-account-settings/my-account-video-settings'
16import { ActorAvatarInfoComponent } from '@app/+my-account/shared/actor-avatar-info.component'
17import { AccountService } from '@app/shared/account/account.service'
18import { FromNowPipe } from '@app/shared/angular/from-now.pipe'
19import { HighlightPipe } from '@app/shared/angular/highlight.pipe'
20import { NumberFormatterPipe } from '@app/shared/angular/number-formatter.pipe'
21import { ObjectLengthPipe } from '@app/shared/angular/object-length.pipe'
22import { PeerTubeTemplateDirective } from '@app/shared/angular/peertube-template.directive'
23import { VideoDurationPipe } from '@app/shared/angular/video-duration-formatter.pipe'
24import { BlocklistService } from '@app/shared/blocklist'
25import { ActionDropdownComponent } from '@app/shared/buttons/action-dropdown.component'
26import { AvatarComponent } from '@app/shared/channel/avatar.component'
27import { ConfirmComponent } from '@app/shared/confirm/confirm.component'
28import { DateToggleComponent } from '@app/shared/date/date-toggle.component'
29import {
30 CustomConfigValidatorsService,
31 InstanceValidatorsService,
32 LoginValidatorsService,
33 ReactiveFileComponent,
34 ResetPasswordValidatorsService,
35 TextareaAutoResizeDirective,
36 UserValidatorsService,
37 VideoAbuseValidatorsService,
38 VideoAcceptOwnershipValidatorsService,
39 VideoBlockValidatorsService,
40 VideoChangeOwnershipValidatorsService,
41 VideoChannelValidatorsService,
42 VideoCommentValidatorsService,
43 VideoPlaylistValidatorsService,
44 VideoValidatorsService
45} from '@app/shared/forms'
46import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
47import { VideoCaptionsValidatorsService } from '@app/shared/forms/form-validators/video-captions-validators.service'
48import { InputReadonlyCopyComponent } from '@app/shared/forms/input-readonly-copy.component'
49import { MarkdownTextareaComponent } from '@app/shared/forms/markdown-textarea.component'
50import { PeertubeCheckboxComponent } from '@app/shared/forms/peertube-checkbox.component'
51import { TimestampInputComponent } from '@app/shared/forms/timestamp-input.component'
52import { I18nPrimengCalendarService } from '@app/shared/i18n/i18n-primeng-calendar'
53import { GlobalIconComponent } from '@app/shared/images/global-icon.component'
54import { PreviewUploadComponent } from '@app/shared/images/preview-upload.component'
55import { FeatureBooleanComponent } from '@app/shared/instance/feature-boolean.component'
56import { FollowService } from '@app/shared/instance/follow.service'
57import { InstanceFeaturesTableComponent } from '@app/shared/instance/instance-features-table.component'
58import { InstanceStatisticsComponent } from '@app/shared/instance/instance-statistics.component'
59import { InstanceService } from '@app/shared/instance/instance.service'
60import { TopMenuDropdownComponent } from '@app/shared/menu/top-menu-dropdown.component'
61import { HelpComponent } from '@app/shared/misc/help.component'
62import { ListOverflowComponent } from '@app/shared/misc/list-overflow.component'
63import { ScreenService } from '@app/shared/misc/screen.service'
64import { SmallLoaderComponent } from '@app/shared/misc/small-loader.component'
65import { LocalStorageService, SessionStorageService } from '@app/shared/misc/storage.service'
66import { UserBanModalComponent } from '@app/shared/moderation'
67import { UserModerationDropdownComponent } from '@app/shared/moderation/user-moderation-dropdown.component'
68import { OverviewService } from '@app/shared/overview'
69import { HtmlRendererService, LinkifierService, MarkdownService } from '@app/shared/renderer'
70import { RemoteSubscribeComponent, SubscribeButtonComponent, UserSubscriptionService } from '@app/shared/user-subscription'
71import { UserHistoryService } from '@app/shared/users/user-history.service'
72import { UserNotificationService } from '@app/shared/users/user-notification.service'
73import { UserNotificationsComponent } from '@app/shared/users/user-notifications.component'
74import { VideoCaptionService } from '@app/shared/video-caption'
75import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
76import { VideoImportService } from '@app/shared/video-import/video-import.service'
77import { VideoAddToPlaylistComponent } from '@app/shared/video-playlist/video-add-to-playlist.component'
78import { VideoPlaylistElementMiniatureComponent } from '@app/shared/video-playlist/video-playlist-element-miniature.component'
79import { VideoPlaylistMiniatureComponent } from '@app/shared/video-playlist/video-playlist-miniature.component'
80import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
81import { InfiniteScrollerDirective } from '@app/shared/video/infinite-scroller.directive'
82import { VideoBlockComponent } from '@app/shared/video/modals/video-block.component'
83import { VideoDownloadComponent } from '@app/shared/video/modals/video-download.component'
84import { VideoReportComponent } from '@app/shared/video/modals/video-report.component'
85import { RedundancyService } from '@app/shared/video/redundancy.service'
86import { VideoActionsDropdownComponent } from '@app/shared/video/video-actions-dropdown.component'
87import { VideosSelectionComponent } from '@app/shared/video/videos-selection.component'
88import {
89 NgbCollapseModule,
90 NgbDropdownModule,
91 NgbModalModule,
92 NgbNavModule,
93 NgbPopoverModule,
94 NgbTooltipModule
95} from '@ng-bootstrap/ng-bootstrap'
96import { I18n } from '@ngx-translate/i18n-polyfill'
97import { AUTH_INTERCEPTOR_PROVIDER } from './auth'
98import { BulkService } from './bulk/bulk.service'
99import { ButtonComponent } from './buttons/button.component'
100import { DeleteButtonComponent } from './buttons/delete-button.component'
101import { EditButtonComponent } from './buttons/edit-button.component'
102import { LoaderComponent } from './misc/loader.component'
103import { RestExtractor, RestService } from './rest'
104import { UserService } from './users'
105import { VideoAbuseService } from './video-abuse'
106import { VideoBlockService } from './video-block'
107import { VideoOwnershipService } from './video-ownership'
108import { FeedComponent } from './video/feed.component'
109import { VideoMiniatureComponent } from './video/video-miniature.component'
110import { VideoThumbnailComponent } from './video/video-thumbnail.component'
111import { VideoService } from './video/video.service'
112
113@NgModule({
114 imports: [
115 CommonModule,
116 FormsModule,
117 ReactiveFormsModule,
118 RouterModule,
119 HttpClientModule,
120
121 NgbDropdownModule,
122 NgbModalModule,
123 NgbPopoverModule,
124 NgbNavModule,
125 NgbTooltipModule,
126 NgbCollapseModule,
127
128 ClipboardModule,
129
130 PrimeSharedModule,
131 InputMaskModule,
132 NgPipesModule,
133 MultiSelectModule,
134 InputSwitchModule
135 ],
136
137 declarations: [
138 LoaderComponent,
139 SmallLoaderComponent,
140
141 VideoThumbnailComponent,
142 VideoMiniatureComponent,
143 VideoPlaylistMiniatureComponent,
144 VideoAddToPlaylistComponent,
145 VideoPlaylistElementMiniatureComponent,
146 VideosSelectionComponent,
147 VideoActionsDropdownComponent,
148
149 VideoDownloadComponent,
150 VideoReportComponent,
151 VideoBlockComponent,
152
153 FeedComponent,
154
155 ButtonComponent,
156 DeleteButtonComponent,
157 EditButtonComponent,
158
159 NumberFormatterPipe,
160 ObjectLengthPipe,
161 FromNowPipe,
162 HighlightPipe,
163 PeerTubeTemplateDirective,
164 VideoDurationPipe,
165
166 ActionDropdownComponent,
167 MarkdownTextareaComponent,
168 InfiniteScrollerDirective,
169 TextareaAutoResizeDirective,
170 HelpComponent,
171 ListOverflowComponent,
172
173 ReactiveFileComponent,
174 PeertubeCheckboxComponent,
175 TimestampInputComponent,
176 InputReadonlyCopyComponent,
177
178 AvatarComponent,
179 SubscribeButtonComponent,
180 RemoteSubscribeComponent,
181 InstanceFeaturesTableComponent,
182 InstanceStatisticsComponent,
183 FeatureBooleanComponent,
184 UserBanModalComponent,
185 UserModerationDropdownComponent,
186 TopMenuDropdownComponent,
187 UserNotificationsComponent,
188 ConfirmComponent,
189 DateToggleComponent,
190
191 GlobalIconComponent,
192 PreviewUploadComponent,
193
194 MyAccountVideoSettingsComponent,
195 MyAccountInterfaceSettingsComponent,
196 ActorAvatarInfoComponent,
197 BatchDomainsModalComponent
198 ],
199
200 exports: [
201 CommonModule,
202 FormsModule,
203 ReactiveFormsModule,
204 RouterModule,
205 HttpClientModule,
206
207 NgbDropdownModule,
208 NgbModalModule,
209 NgbPopoverModule,
210 NgbNavModule,
211 NgbTooltipModule,
212 NgbCollapseModule,
213
214 ClipboardModule,
215
216 PrimeSharedModule,
217 InputMaskModule,
218 BytesPipe,
219 KeysPipe,
220 MultiSelectModule,
221
222 LoaderComponent,
223 SmallLoaderComponent,
224
225 VideoThumbnailComponent,
226 VideoMiniatureComponent,
227 VideoPlaylistMiniatureComponent,
228 VideoAddToPlaylistComponent,
229 VideoPlaylistElementMiniatureComponent,
230 VideosSelectionComponent,
231 VideoActionsDropdownComponent,
232
233 VideoDownloadComponent,
234 VideoReportComponent,
235 VideoBlockComponent,
236
237 FeedComponent,
238
239 ButtonComponent,
240 DeleteButtonComponent,
241 EditButtonComponent,
242
243 ActionDropdownComponent,
244 MarkdownTextareaComponent,
245 InfiniteScrollerDirective,
246 TextareaAutoResizeDirective,
247 HelpComponent,
248 ListOverflowComponent,
249 InputReadonlyCopyComponent,
250
251 ReactiveFileComponent,
252 PeertubeCheckboxComponent,
253 TimestampInputComponent,
254
255 AvatarComponent,
256 SubscribeButtonComponent,
257 RemoteSubscribeComponent,
258 InstanceFeaturesTableComponent,
259 InstanceStatisticsComponent,
260 UserBanModalComponent,
261 UserModerationDropdownComponent,
262 TopMenuDropdownComponent,
263 UserNotificationsComponent,
264 ConfirmComponent,
265 DateToggleComponent,
266
267 GlobalIconComponent,
268 PreviewUploadComponent,
269
270 NumberFormatterPipe,
271 ObjectLengthPipe,
272 FromNowPipe,
273 HighlightPipe,
274 PeerTubeTemplateDirective,
275 VideoDurationPipe,
276
277 MyAccountVideoSettingsComponent,
278 MyAccountInterfaceSettingsComponent,
279 ActorAvatarInfoComponent,
280 BatchDomainsModalComponent
281 ],
282
283 providers: [
284 AUTH_INTERCEPTOR_PROVIDER,
285 RestExtractor,
286 RestService,
287 VideoAbuseService,
288 VideoBlockService,
289 VideoOwnershipService,
290 UserService,
291 VideoService,
292 AccountService,
293 VideoChannelService,
294 VideoPlaylistService,
295 VideoCaptionService,
296 VideoImportService,
297 UserSubscriptionService,
298
299 FormValidatorService,
300 CustomConfigValidatorsService,
301 LoginValidatorsService,
302 ResetPasswordValidatorsService,
303 UserValidatorsService,
304 BatchDomainsValidatorsService,
305 VideoPlaylistValidatorsService,
306 VideoAbuseValidatorsService,
307 VideoChannelValidatorsService,
308 VideoCommentValidatorsService,
309 VideoValidatorsService,
310 VideoCaptionsValidatorsService,
311 VideoBlockValidatorsService,
312 OverviewService,
313 VideoChangeOwnershipValidatorsService,
314 VideoAcceptOwnershipValidatorsService,
315 InstanceValidatorsService,
316 BlocklistService,
317 UserHistoryService,
318 InstanceService,
319 BulkService,
320
321 MarkdownService,
322 LinkifierService,
323 HtmlRendererService,
324
325 I18nPrimengCalendarService,
326 ScreenService,
327 LocalStorageService, SessionStorageService,
328
329 UserNotificationService,
330
331 FollowService,
332 RedundancyService,
333
334 I18n
335 ]
336})
337export class SharedModule { }
diff --git a/client/src/app/shared/video-abuse/index.ts b/client/src/app/shared/video-abuse/index.ts
deleted file mode 100644
index 92cbfb5f9..000000000
--- a/client/src/app/shared/video-abuse/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-abuse.service'
diff --git a/client/src/app/shared/video-block/index.ts b/client/src/app/shared/video-block/index.ts
deleted file mode 100644
index a99551a38..000000000
--- a/client/src/app/shared/video-block/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-block.service'
diff --git a/client/src/app/shared/video-caption/index.ts b/client/src/app/shared/video-caption/index.ts
deleted file mode 100644
index c48a70558..000000000
--- a/client/src/app/shared/video-caption/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-caption.service'
diff --git a/client/src/app/shared/video-import/index.ts b/client/src/app/shared/video-import/index.ts
deleted file mode 100644
index 9bb73ec2c..000000000
--- a/client/src/app/shared/video-import/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-import.service'
diff --git a/client/src/app/shared/video-ownership/index.ts b/client/src/app/shared/video-ownership/index.ts
deleted file mode 100644
index fe8902ee2..000000000
--- a/client/src/app/shared/video-ownership/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './video-ownership.service'
diff --git a/client/src/app/shared/video/sort-field.type.ts b/client/src/app/shared/video/sort-field.type.ts
deleted file mode 100644
index 65b24d946..000000000
--- a/client/src/app/shared/video/sort-field.type.ts
+++ /dev/null
@@ -1,10 +0,0 @@
1export type VideoSortField = 'name' | '-name'
2 | 'duration' | '-duration'
3 | 'publishedAt' | '-publishedAt'
4 | 'createdAt' | '-createdAt'
5 | 'views' | '-views'
6 | 'likes' | '-likes'
7 | 'trending' | '-trending'
8
9export type CommentSortField = 'createdAt' | '-createdAt'
10 | 'totalReplies' | '-totalReplies'
diff --git a/client/src/app/shared/i18n/i18n-primeng-calendar.ts b/client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts
index b05852ff8..b05852ff8 100644
--- a/client/src/app/shared/i18n/i18n-primeng-calendar.ts
+++ b/client/src/app/videos/+video-edit/shared/i18n-primeng-calendar.service.ts
diff --git a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts
index 9856aac9e..a90d04ce8 100644
--- a/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-caption-add-modal.component.ts
@@ -1,11 +1,9 @@
1import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
2import { FormReactive } from '@app/shared'
3import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
4import { VideoCaptionsValidatorsService } from '@app/shared/forms/form-validators/video-captions-validators.service'
5import { ServerService } from '@app/core' 2import { ServerService } from '@app/core'
6import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model' 3import { FormReactive, FormValidatorService, VideoCaptionsValidatorsService } from '@app/shared/shared-forms'
4import { VideoCaptionEdit } from '@app/shared/shared-main'
7import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap' 5import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
8import { ServerConfig, VideoConstant } from '../../../../../../shared' 6import { ServerConfig, VideoConstant } from '@shared/models'
9 7
10@Component({ 8@Component({
11 selector: 'my-video-caption-add-modal', 9 selector: 'my-video-caption-add-modal',
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.ts b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
index 15073fc44..239e453ad 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.ts
@@ -1,19 +1,13 @@
1import { map } from 'rxjs/operators'
1import { Component, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' 2import { Component, Input, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
2import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms' 3import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'
3import { ActivatedRoute, Router } from '@angular/router' 4import { ServerService } from '@app/core'
4import { FormReactiveValidationMessages, VideoValidatorsService } from '@app/shared' 5import { removeElementFromArray } from '@app/helpers'
5import { Notifier } from '@app/core' 6import { FormReactiveValidationMessages, FormValidatorService, VideoValidatorsService } from '@app/shared/shared-forms'
6import { ServerService } from '../../../core/server' 7import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main'
7import { VideoEdit } from '../../../shared/video/video-edit.model' 8import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models'
8import { map } from 'rxjs/operators' 9import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service'
9import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service' 10import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
10import { I18nPrimengCalendarService } from '@app/shared/i18n/i18n-primeng-calendar'
11import { VideoCaptionService } from '@app/shared/video-caption'
12import { VideoCaptionAddModalComponent } from '@app/videos/+video-edit/shared/video-caption-add-modal.component'
13import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
14import { removeElementFromArray } from '@app/shared/misc/utils'
15import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared'
16import { VideoService } from '@app/shared/video/video.service'
17 11
18@Component({ 12@Component({
19 selector: 'my-video-edit', 13 selector: 'my-video-edit',
@@ -60,11 +54,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
60 constructor ( 54 constructor (
61 private formValidatorService: FormValidatorService, 55 private formValidatorService: FormValidatorService,
62 private videoValidatorsService: VideoValidatorsService, 56 private videoValidatorsService: VideoValidatorsService,
63 private videoCaptionService: VideoCaptionService,
64 private videoService: VideoService, 57 private videoService: VideoService,
65 private route: ActivatedRoute,
66 private router: Router,
67 private notifier: Notifier,
68 private serverService: ServerService, 58 private serverService: ServerService,
69 private i18nPrimengCalendarService: I18nPrimengCalendarService, 59 private i18nPrimengCalendarService: I18nPrimengCalendarService,
70 private ngZone: NgZone 60 private ngZone: NgZone
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.module.ts b/client/src/app/videos/+video-edit/shared/video-edit.module.ts
index 1357d607c..96061a300 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.module.ts
+++ b/client/src/app/videos/+video-edit/shared/video-edit.module.ts
@@ -1,16 +1,20 @@
1import { NgModule } from '@angular/core'
2import { TagInputModule } from 'ngx-chips' 1import { TagInputModule } from 'ngx-chips'
3import { SharedModule } from '../../../shared/'
4import { VideoEditComponent } from './video-edit.component'
5import { CalendarModule } from 'primeng/calendar' 2import { CalendarModule } from 'primeng/calendar'
3import { NgModule } from '@angular/core'
4import { SharedFormModule } from '@app/shared/shared-forms'
5import { SharedGlobalIconModule } from '@app/shared/shared-icons'
6import { SharedMainModule } from '@app/shared/shared-main'
6import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' 7import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
8import { VideoEditComponent } from './video-edit.component'
7 9
8@NgModule({ 10@NgModule({
9 imports: [ 11 imports: [
10 TagInputModule, 12 TagInputModule,
11 CalendarModule, 13 CalendarModule,
12 14
13 SharedModule 15 SharedMainModule,
16 SharedFormModule,
17 SharedGlobalIconModule
14 ], 18 ],
15 19
16 declarations: [ 20 declarations: [
@@ -22,6 +26,10 @@ import { VideoCaptionAddModalComponent } from './video-caption-add-modal.compone
22 TagInputModule, 26 TagInputModule,
23 CalendarModule, 27 CalendarModule,
24 28
29 SharedMainModule,
30 SharedFormModule,
31 SharedGlobalIconModule,
32
25 VideoEditComponent 33 VideoEditComponent
26 ], 34 ],
27 35
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
index 4d0b0b080..5b453a1d9 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
@@ -1,17 +1,13 @@
1import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
2import { Router } from '@angular/router' 2import { Router } from '@angular/router'
3import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos' 3import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core'
4import { AuthService, Notifier, ServerService } from '../../../core' 4import { scrollToTop } from '@app/helpers'
5import { VideoService } from '../../../shared/video/video.service' 5import { FormValidatorService } from '@app/shared/shared-forms'
6import { I18n } from '@ngx-translate/i18n-polyfill' 6import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main'
7import { LoadingBarService } from '@ngx-loading-bar/core'
8import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' 7import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send'
9import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' 8import { LoadingBarService } from '@ngx-loading-bar/core'
10import { VideoEdit } from '@app/shared/video/video-edit.model' 9import { I18n } from '@ngx-translate/i18n-polyfill'
11import { FormValidatorService } from '@app/shared' 10import { VideoPrivacy, VideoUpdate } from '@shared/models'
12import { VideoCaptionService } from '@app/shared/video-caption'
13import { VideoImportService } from '@app/shared/video-import'
14import { scrollToTop } from '@app/shared/misc/utils'
15 11
16@Component({ 12@Component({
17 selector: 'my-video-import-torrent', 13 selector: 'my-video-import-torrent',
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts
index 213c42333..d0bd1f54d 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts
@@ -1,18 +1,14 @@
1import { map, switchMap } from 'rxjs/operators'
1import { Component, EventEmitter, OnInit, Output } from '@angular/core' 2import { Component, EventEmitter, OnInit, Output } from '@angular/core'
2import { Router } from '@angular/router' 3import { Router } from '@angular/router'
3import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos' 4import { AuthService, CanComponentDeactivate, Notifier, ServerService } from '@app/core'
4import { AuthService, Notifier, ServerService } from '../../../core' 5import { getAbsoluteAPIUrl, scrollToTop } from '@app/helpers'
5import { VideoService } from '../../../shared/video/video.service' 6import { FormValidatorService } from '@app/shared/shared-forms'
6import { I18n } from '@ngx-translate/i18n-polyfill' 7import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main'
7import { LoadingBarService } from '@ngx-loading-bar/core'
8import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' 8import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send'
9import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' 9import { LoadingBarService } from '@ngx-loading-bar/core'
10import { VideoEdit } from '@app/shared/video/video-edit.model' 10import { I18n } from '@ngx-translate/i18n-polyfill'
11import { FormValidatorService } from '@app/shared' 11import { VideoPrivacy, VideoUpdate } from '@shared/models'
12import { VideoCaptionService } from '@app/shared/video-caption'
13import { VideoImportService } from '@app/shared/video-import'
14import { scrollToTop, getAbsoluteAPIUrl } from '@app/shared/misc/utils'
15import { switchMap, map } from 'rxjs/operators'
16 12
17@Component({ 13@Component({
18 selector: 'my-video-import-url', 14 selector: 'my-video-import-url',
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-send.ts b/client/src/app/videos/+video-edit/video-add-components/video-send.ts
index b32f16950..94479321d 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-send.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-send.ts
@@ -1,15 +1,11 @@
1import { catchError, switchMap, tap } from 'rxjs/operators'
1import { EventEmitter, OnInit } from '@angular/core' 2import { EventEmitter, OnInit } from '@angular/core'
3import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core'
4import { populateAsyncUserVideoChannels } from '@app/helpers'
5import { FormReactive } from '@app/shared/shared-forms'
6import { VideoCaptionEdit, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
2import { LoadingBarService } from '@ngx-loading-bar/core' 7import { LoadingBarService } from '@ngx-loading-bar/core'
3import { AuthService, Notifier, ServerService } from '@app/core' 8import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models'
4import { catchError, switchMap, tap } from 'rxjs/operators'
5import { FormReactive } from '@app/shared'
6import { ServerConfig, VideoConstant, VideoPrivacy } from '../../../../../../shared'
7import { VideoService } from '@app/shared/video/video.service'
8import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
9import { VideoCaptionService } from '@app/shared/video-caption'
10import { VideoEdit } from '@app/shared/video/video-edit.model'
11import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils'
12import { CanComponentDeactivateResult } from '@app/shared/guards/can-deactivate-guard.service'
13 9
14export abstract class VideoSend extends FormReactive implements OnInit { 10export abstract class VideoSend extends FormReactive implements OnInit {
15 userVideoChannels: { id: number, label: string, support: string }[] = [] 11 userVideoChannels: { id: number, label: string, support: string }[] = []
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
index 9ce3fbc6d..eb7ac32ae 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
@@ -1,19 +1,16 @@
1import { BytesPipe } from 'ngx-pipes'
2import { Subscription } from 'rxjs'
1import { HttpEventType, HttpResponse } from '@angular/common/http' 3import { HttpEventType, HttpResponse } from '@angular/common/http'
2import { Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' 4import { Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
3import { Router } from '@angular/router' 5import { Router } from '@angular/router'
6import { AuthService, CanComponentDeactivate, Notifier, ServerService, UserService } from '@app/core'
7import { scrollToTop } from '@app/helpers'
8import { FormValidatorService } from '@app/shared/shared-forms'
9import { VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
10import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send'
4import { LoadingBarService } from '@ngx-loading-bar/core' 11import { LoadingBarService } from '@ngx-loading-bar/core'
5import { BytesPipe } from 'ngx-pipes'
6import { Subscription } from 'rxjs'
7import { VideoPrivacy } from '../../../../../../shared/models/videos'
8import { AuthService, Notifier, ServerService } from '../../../core'
9import { VideoEdit } from '../../../shared/video/video-edit.model'
10import { VideoService } from '../../../shared/video/video.service'
11import { I18n } from '@ngx-translate/i18n-polyfill' 12import { I18n } from '@ngx-translate/i18n-polyfill'
12import { VideoSend } from '@app/videos/+video-edit/video-add-components/video-send' 13import { VideoPrivacy } from '@shared/models'
13import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service'
14import { FormValidatorService, UserService } from '@app/shared'
15import { VideoCaptionService } from '@app/shared/video-caption'
16import { scrollToTop } from '@app/shared/misc/utils'
17 14
18@Component({ 15@Component({
19 selector: 'my-video-upload', 16 selector: 'my-video-upload',
diff --git a/client/src/app/videos/+video-edit/video-add-routing.module.ts b/client/src/app/videos/+video-edit/video-add-routing.module.ts
index e0fef7158..9ff66bea0 100644
--- a/client/src/app/videos/+video-edit/video-add-routing.module.ts
+++ b/client/src/app/videos/+video-edit/video-add-routing.module.ts
@@ -1,10 +1,7 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3 3import { CanDeactivateGuard, LoginGuard } from '@app/core'
4import { MetaGuard } from '@ngx-meta/core' 4import { MetaGuard } from '@ngx-meta/core'
5
6import { LoginGuard } from '../../core'
7import { CanDeactivateGuard } from '../../shared/guards/can-deactivate-guard.service'
8import { VideoAddComponent } from './video-add.component' 5import { VideoAddComponent } from './video-add.component'
9 6
10const videoAddRoutes: Routes = [ 7const videoAddRoutes: Routes = [
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts
index 30ab08ea0..5bd768809 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -1,10 +1,9 @@
1import { Component, HostListener, OnInit, ViewChild } from '@angular/core' 1import { Component, HostListener, OnInit, ViewChild } from '@angular/core'
2import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' 2import { AuthService, CanComponentDeactivate, ServerService } from '@app/core'
3import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component'
4import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component'
5import { AuthService, ServerService } from '@app/core'
6import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component'
7import { ServerConfig } from '@shared/models' 3import { ServerConfig } from '@shared/models'
4import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component'
5import { VideoImportUrlComponent } from './video-add-components/video-import-url.component'
6import { VideoUploadComponent } from './video-add-components/video-upload.component'
8 7
9@Component({ 8@Component({
10 selector: 'my-videos-add', 9 selector: 'my-videos-add',
diff --git a/client/src/app/videos/+video-edit/video-add.module.ts b/client/src/app/videos/+video-edit/video-add.module.ts
index b8f5a9a47..477c1cf5e 100644
--- a/client/src/app/videos/+video-edit/video-add.module.ts
+++ b/client/src/app/videos/+video-edit/video-add.module.ts
@@ -1,20 +1,20 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { SharedModule } from '../../shared' 2import { CanDeactivateGuard } from '@app/core'
3import { VideoEditModule } from './shared/video-edit.module' 3import { VideoEditModule } from './shared/video-edit.module'
4import { DragDropDirective } from './video-add-components/drag-drop.directive'
5import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component'
6import { VideoImportUrlComponent } from './video-add-components/video-import-url.component'
7import { VideoUploadComponent } from './video-add-components/video-upload.component'
4import { VideoAddRoutingModule } from './video-add-routing.module' 8import { VideoAddRoutingModule } from './video-add-routing.module'
5import { VideoAddComponent } from './video-add.component' 9import { VideoAddComponent } from './video-add.component'
6import { DragDropDirective } from './video-add-components/drag-drop.directive'
7import { CanDeactivateGuard } from '../../shared/guards/can-deactivate-guard.service'
8import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component'
9import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component'
10import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component'
11 10
12@NgModule({ 11@NgModule({
13 imports: [ 12 imports: [
14 VideoAddRoutingModule, 13 VideoAddRoutingModule,
15 VideoEditModule, 14
16 SharedModule 15 VideoEditModule
17 ], 16 ],
17
18 declarations: [ 18 declarations: [
19 VideoAddComponent, 19 VideoAddComponent,
20 VideoUploadComponent, 20 VideoUploadComponent,
@@ -22,10 +22,9 @@ import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-c
22 VideoImportTorrentComponent, 22 VideoImportTorrentComponent,
23 DragDropDirective 23 DragDropDirective
24 ], 24 ],
25 exports: [ 25
26 VideoAddComponent, 26 exports: [ ],
27 DragDropDirective 27
28 ],
29 providers: [ 28 providers: [
30 CanDeactivateGuard 29 CanDeactivateGuard
31 ] 30 ]
diff --git a/client/src/app/videos/+video-edit/video-update-routing.module.ts b/client/src/app/videos/+video-edit/video-update-routing.module.ts
index 564b8fb45..a04351b05 100644
--- a/client/src/app/videos/+video-edit/video-update-routing.module.ts
+++ b/client/src/app/videos/+video-edit/video-update-routing.module.ts
@@ -1,12 +1,9 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3 3import { CanDeactivateGuard, LoginGuard } from '@app/core'
4import { MetaGuard } from '@ngx-meta/core' 4import { MetaGuard } from '@ngx-meta/core'
5
6import { LoginGuard } from '../../core'
7import { VideoUpdateComponent } from './video-update.component' 5import { VideoUpdateComponent } from './video-update.component'
8import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver' 6import { VideoUpdateResolver } from './video-update.resolver'
9import { CanDeactivateGuard } from '@app/shared/guards/can-deactivate-guard.service'
10 7
11const videoUpdateRoutes: Routes = [ 8const videoUpdateRoutes: Routes = [
12 { 9 {
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts
index 20a607134..7bd6eb553 100644
--- a/client/src/app/videos/+video-edit/video-update.component.ts
+++ b/client/src/app/videos/+video-edit/video-update.component.ts
@@ -1,17 +1,11 @@
1import { map, switchMap } from 'rxjs/operators' 1import { map, switchMap } from 'rxjs/operators'
2import { Component, HostListener, OnInit } from '@angular/core' 2import { Component, HostListener, OnInit } from '@angular/core'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { LoadingBarService } from '@ngx-loading-bar/core'
5import { Notifier } from '@app/core' 4import { Notifier } from '@app/core'
6import { ServerService } from '../../core' 5import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
7import { FormReactive } from '../../shared' 6import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main'
8import { VideoEdit } from '../../shared/video/video-edit.model' 7import { LoadingBarService } from '@ngx-loading-bar/core'
9import { VideoService } from '../../shared/video/video.service'
10import { I18n } from '@ngx-translate/i18n-polyfill' 8import { I18n } from '@ngx-translate/i18n-polyfill'
11import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
12import { VideoCaptionService } from '@app/shared/video-caption'
13import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
14import { VideoDetails } from '@app/shared/video/video-details.model'
15import { VideoPrivacy } from '@shared/models' 9import { VideoPrivacy } from '@shared/models'
16 10
17@Component({ 11@Component({
diff --git a/client/src/app/videos/+video-edit/video-update.module.ts b/client/src/app/videos/+video-edit/video-update.module.ts
index d60aa699f..322c69629 100644
--- a/client/src/app/videos/+video-edit/video-update.module.ts
+++ b/client/src/app/videos/+video-edit/video-update.module.ts
@@ -1,25 +1,22 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { SharedModule } from '../../shared' 2import { CanDeactivateGuard } from '@app/core'
3import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver'
3import { VideoEditModule } from './shared/video-edit.module' 4import { VideoEditModule } from './shared/video-edit.module'
4import { VideoUpdateRoutingModule } from './video-update-routing.module' 5import { VideoUpdateRoutingModule } from './video-update-routing.module'
5import { VideoUpdateComponent } from './video-update.component' 6import { VideoUpdateComponent } from './video-update.component'
6import { VideoUpdateResolver } from '@app/videos/+video-edit/video-update.resolver'
7import { CanDeactivateGuard } from '@app/shared/guards/can-deactivate-guard.service'
8 7
9@NgModule({ 8@NgModule({
10 imports: [ 9 imports: [
11 VideoUpdateRoutingModule, 10 VideoUpdateRoutingModule,
12 VideoEditModule, 11
13 SharedModule 12 VideoEditModule
14 ], 13 ],
15 14
16 declarations: [ 15 declarations: [
17 VideoUpdateComponent 16 VideoUpdateComponent
18 ], 17 ],
19 18
20 exports: [ 19 exports: [ ],
21 VideoUpdateComponent
22 ],
23 20
24 providers: [ 21 providers: [
25 VideoUpdateResolver, 22 VideoUpdateResolver,
diff --git a/client/src/app/videos/+video-edit/video-update.resolver.ts b/client/src/app/videos/+video-edit/video-update.resolver.ts
index 4ac517d96..30bcf4d74 100644
--- a/client/src/app/videos/+video-edit/video-update.resolver.ts
+++ b/client/src/app/videos/+video-edit/video-update.resolver.ts
@@ -1,10 +1,8 @@
1import { forkJoin } from 'rxjs'
2import { map, switchMap } from 'rxjs/operators'
1import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
2import { VideoService } from '@app/shared/video/video.service'
3import { ActivatedRouteSnapshot, Resolve } from '@angular/router' 4import { ActivatedRouteSnapshot, Resolve } from '@angular/router'
4import { map, switchMap } from 'rxjs/operators' 5import { VideoCaptionService, VideoChannelService, VideoService } from '@app/shared/shared-main'
5import { VideoChannelService } from '@app/shared/video-channel/video-channel.service'
6import { VideoCaptionService } from '@app/shared/video-caption'
7import { forkJoin } from 'rxjs'
8 6
9@Injectable() 7@Injectable()
10export class VideoUpdateResolver implements Resolve<any> { 8export class VideoUpdateResolver implements Resolve<any> {
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
index e1a8f6260..79505c779 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment-add.component.ts
@@ -1,16 +1,13 @@
1import { Observable } from 'rxjs'
1import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core' 2import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
2import { Router } from '@angular/router' 3import { Router } from '@angular/router'
3import { Notifier } from '@app/core' 4import { Notifier, User } from '@app/core'
4import { Observable } from 'rxjs' 5import { FormReactive, FormValidatorService, VideoCommentValidatorsService } from '@app/shared/shared-forms'
5import { VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model' 6import { Video } from '@app/shared/shared-main'
6import { FormReactive } from '../../../shared' 7import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
7import { User } from '../../../shared/users' 8import { VideoCommentCreate } from '@shared/models'
8import { Video } from '../../../shared/video/video.model'
9import { VideoComment } from './video-comment.model' 9import { VideoComment } from './video-comment.model'
10import { VideoCommentService } from './video-comment.service' 10import { VideoCommentService } from './video-comment.service'
11import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
12import { VideoCommentValidatorsService } from '@app/shared/forms/form-validators/video-comment-validators.service'
13import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
14 11
15@Component({ 12@Component({
16 selector: 'my-video-comment-add', 13 selector: 'my-video-comment-add',
diff --git a/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts b/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts
index 1566d7369..7c2aaeadd 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment-thread-tree.model.ts
@@ -1,5 +1,5 @@
1import { VideoCommentThreadTree as VideoCommentThreadTreeServerModel } from '../../../../../../shared/models/videos/video-comment.model' 1import { VideoCommentThreadTree as VideoCommentThreadTreeServerModel } from '@shared/models'
2import { VideoComment } from '@app/videos/+video-watch/comment/video-comment.model' 2import { VideoComment } from './video-comment.model'
3 3
4export class VideoCommentThreadTree implements VideoCommentThreadTreeServerModel { 4export class VideoCommentThreadTree implements VideoCommentThreadTreeServerModel {
5 comment: VideoComment 5 comment: VideoComment
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
index 868addd58..27846c1ad 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts
@@ -1,15 +1,10 @@
1import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core' 1import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'
2import { User, UserRight } from '../../../../../../shared/models/users' 2import { MarkdownService, Notifier, UserService } from '@app/core'
3import { AuthService } from '@app/core/auth' 3import { AuthService } from '@app/core/auth'
4import { AccountService } from '@app/shared/account/account.service' 4import { Account, Actor, Video } from '@app/shared/shared-main'
5import { Video } from '@app/shared/video/video.model' 5import { User, UserRight } from '@shared/models'
6import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
6import { VideoComment } from './video-comment.model' 7import { VideoComment } from './video-comment.model'
7import { MarkdownService } from '@app/shared/renderer'
8import { Account } from '@app/shared/account/account.model'
9import { Notifier } from '@app/core'
10import { UserService } from '@app/shared'
11import { Actor } from '@app/shared/actor/actor.model'
12import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model'
13 8
14@Component({ 9@Component({
15 selector: 'my-video-comment', 10 selector: 'my-video-comment',
@@ -40,7 +35,6 @@ export class VideoCommentComponent implements OnInit, OnChanges {
40 constructor ( 35 constructor (
41 private markdownService: MarkdownService, 36 private markdownService: MarkdownService,
42 private authService: AuthService, 37 private authService: AuthService,
43 private accountService: AccountService,
44 private userService: UserService, 38 private userService: UserService,
45 private notifier: Notifier 39 private notifier: Notifier
46 ) {} 40 ) {}
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.model.ts b/client/src/app/videos/+video-watch/comment/video-comment.model.ts
index 171fc4acc..e85443196 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.model.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.model.ts
@@ -1,7 +1,6 @@
1import { Account as AccountInterface } from '../../../../../../shared/models/actors' 1import { getAbsoluteAPIUrl } from '@app/helpers'
2import { VideoComment as VideoCommentServerModel, VideoCommentCreate } from '../../../../../../shared/models/videos/video-comment.model' 2import { Actor } from '@app/shared/shared-main'
3import { Actor } from '@app/shared/actor/actor.model' 3import { Account as AccountInterface, VideoComment as VideoCommentServerModel } from '@shared/models'
4import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'
5 4
6export class VideoComment implements VideoCommentServerModel { 5export class VideoComment implements VideoCommentServerModel {
7 id: number 6 id: number
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.service.ts b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
index 0b0715390..a73fb9ca8 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.service.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
@@ -1,20 +1,19 @@
1import { Observable } from 'rxjs'
1import { catchError, map } from 'rxjs/operators' 2import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { objectLineFeedToHtml } from '@app/shared/misc/utils' 5import { ComponentPaginationLight, RestExtractor, RestService } from '@app/core'
5import { Observable } from 'rxjs' 6import { objectLineFeedToHtml } from '@app/helpers'
6import { FeedFormat, ResultList } from '../../../../../../shared/models'
7import { 7import {
8 FeedFormat,
9 ResultList,
8 VideoComment as VideoCommentServerModel, 10 VideoComment as VideoCommentServerModel,
9 VideoCommentCreate, 11 VideoCommentCreate,
10 VideoCommentThreadTree as VideoCommentThreadTreeServerModel 12 VideoCommentThreadTree as VideoCommentThreadTreeServerModel
11} from '../../../../../../shared/models/videos/video-comment.model' 13} from '@shared/models'
12import { environment } from '../../../../environments/environment' 14import { environment } from '../../../../environments/environment'
13import { RestExtractor, RestService } from '../../../shared/rest' 15import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
14import { ComponentPaginationLight } from '../../../shared/rest/component-pagination.model'
15import { CommentSortField } from '../../../shared/video/sort-field.type'
16import { VideoComment } from './video-comment.model' 16import { VideoComment } from './video-comment.model'
17import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model'
18 17
19@Injectable() 18@Injectable()
20export class VideoCommentService { 19export class VideoCommentService {
@@ -52,7 +51,7 @@ export class VideoCommentService {
52 getVideoCommentThreads (parameters: { 51 getVideoCommentThreads (parameters: {
53 videoId: number | string, 52 videoId: number | string,
54 componentPagination: ComponentPaginationLight, 53 componentPagination: ComponentPaginationLight,
55 sort: CommentSortField 54 sort: string
56 }): Observable<ResultList<VideoComment>> { 55 }): Observable<ResultList<VideoComment>> {
57 const { videoId, componentPagination, sort } = parameters 56 const { videoId, componentPagination, sort } = parameters
58 57
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
index bba9f1372..df0018ec6 100644
--- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
@@ -1,18 +1,13 @@
1import { Subject, Subscription } from 'rxjs'
1import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' 2import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core'
2import { ActivatedRoute } from '@angular/router' 3import { ActivatedRoute } from '@angular/router'
3import { ConfirmService, Notifier } from '@app/core' 4import { AuthService, ComponentPagination, ConfirmService, hasMoreItems, Notifier, User } from '@app/core'
4import { Subject, Subscription } from 'rxjs' 5import { HooksService } from '@app/core/plugins/hooks.service'
5import { AuthService } from '../../../core/auth' 6import { Syndication, VideoDetails } from '@app/shared/shared-main'
6import { ComponentPagination, hasMoreItems } from '../../../shared/rest/component-pagination.model' 7import { I18n } from '@ngx-translate/i18n-polyfill'
7import { User } from '../../../shared/users' 8import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
8import { CommentSortField } from '../../../shared/video/sort-field.type'
9import { VideoDetails } from '../../../shared/video/video-details.model'
10import { VideoComment } from './video-comment.model' 9import { VideoComment } from './video-comment.model'
11import { VideoCommentService } from './video-comment.service' 10import { VideoCommentService } from './video-comment.service'
12import { I18n } from '@ngx-translate/i18n-polyfill'
13import { Syndication } from '@app/shared/video/syndication.model'
14import { HooksService } from '@app/core/plugins/hooks.service'
15import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model'
16 11
17@Component({ 12@Component({
18 selector: 'my-video-comments', 13 selector: 'my-video-comments',
@@ -28,7 +23,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
28 23
29 comments: VideoComment[] = [] 24 comments: VideoComment[] = []
30 highlightedThread: VideoComment 25 highlightedThread: VideoComment
31 sort: CommentSortField = '-createdAt' 26 sort = '-createdAt'
32 componentPagination: ComponentPagination = { 27 componentPagination: ComponentPagination = {
33 currentPage: 1, 28 currentPage: 1,
34 itemsPerPage: 10, 29 itemsPerPage: 10,
@@ -154,7 +149,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
154 this.viewReplies(commentTree.comment.id) 149 this.viewReplies(commentTree.comment.id)
155 } 150 }
156 151
157 handleSortChange (sort: CommentSortField) { 152 handleSortChange (sort: string) {
158 if (this.sort === sort) return 153 if (this.sort === sort) return
159 154
160 this.sort = sort 155 this.sort = sort
diff --git a/client/src/app/videos/+video-watch/modal/video-share.component.ts b/client/src/app/videos/+video-watch/modal/video-share.component.ts
index 3550556a0..b42b775c1 100644
--- a/client/src/app/videos/+video-watch/modal/video-share.component.ts
+++ b/client/src/app/videos/+video-watch/modal/video-share.component.ts
@@ -1,9 +1,9 @@
1import { Component, ElementRef, Input, ViewChild } from '@angular/core' 1import { Component, ElementRef, Input, ViewChild } from '@angular/core'
2import { VideoDetails } from '../../../shared/video/video-details.model'
3import { buildVideoEmbed, buildVideoLink } from '../../../../assets/player/utils' 2import { buildVideoEmbed, buildVideoLink } from '../../../../assets/player/utils'
4import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 3import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
5import { VideoCaption } from '@shared/models' 4import { VideoCaption } from '@shared/models'
6import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model' 5import { VideoDetails } from '@app/shared/shared-main'
6import { VideoPlaylist } from '@app/shared/shared-video-playlist'
7 7
8type Customizations = { 8type Customizations = {
9 startAtCheckbox: boolean 9 startAtCheckbox: boolean
@@ -40,13 +40,9 @@ export class VideoShareComponent {
40 isAdvancedCustomizationCollapsed = true 40 isAdvancedCustomizationCollapsed = true
41 includeVideoInPlaylist = false 41 includeVideoInPlaylist = false
42 42
43 private currentVideoTimestamp: number
44
45 constructor (private modalService: NgbModal) { } 43 constructor (private modalService: NgbModal) { }
46 44
47 show (currentVideoTimestamp?: number) { 45 show (currentVideoTimestamp?: number) {
48 this.currentVideoTimestamp = currentVideoTimestamp
49
50 let subtitle: string 46 let subtitle: string
51 if (this.videoCaptions.length !== 0) { 47 if (this.videoCaptions.length !== 0) {
52 subtitle = this.videoCaptions[0].language.id 48 subtitle = this.videoCaptions[0].language.id
diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.ts b/client/src/app/videos/+video-watch/modal/video-support.component.ts
index 0058172f2..48d5f2948 100644
--- a/client/src/app/videos/+video-watch/modal/video-support.component.ts
+++ b/client/src/app/videos/+video-watch/modal/video-support.component.ts
@@ -1,7 +1,7 @@
1import { Component, Input, ViewChild } from '@angular/core' 1import { Component, Input, ViewChild } from '@angular/core'
2import { VideoDetails } from '../../../shared/video/video-details.model' 2import { MarkdownService } from '@app/core'
3import { VideoDetails } from '@app/shared/shared-main'
3import { NgbModal } from '@ng-bootstrap/ng-bootstrap' 4import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4import { MarkdownService } from '@app/shared/renderer'
5 5
6@Component({ 6@Component({
7 selector: 'my-video-support', 7 selector: 'my-video-support',
diff --git a/client/src/app/shared/angular/timestamp-route-transformer.directive.ts b/client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts
index 45e023695..45e023695 100644
--- a/client/src/app/shared/angular/timestamp-route-transformer.directive.ts
+++ b/client/src/app/videos/+video-watch/timestamp-route-transformer.directive.ts
diff --git a/client/src/app/shared/angular/video-duration-formatter.pipe.ts b/client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts
index 4b6767415..4b6767415 100644
--- a/client/src/app/shared/angular/video-duration-formatter.pipe.ts
+++ b/client/src/app/videos/+video-watch/video-duration-formatter.pipe.ts
diff --git a/client/src/app/videos/+video-watch/video-watch-playlist.component.ts b/client/src/app/videos/+video-watch/video-watch-playlist.component.ts
index 827c34d41..2c21be643 100644
--- a/client/src/app/videos/+video-watch/video-watch-playlist.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch-playlist.component.ts
@@ -1,15 +1,10 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input } from '@angular/core'
2import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
3import { ComponentPagination } from '@app/shared/rest/component-pagination.model'
4import { VideoDetails, VideoPlaylistPrivacy } from '@shared/models'
5import { Router } from '@angular/router' 2import { Router } from '@angular/router'
6import { UserService } from '@app/shared' 3import { AuthService, ComponentPagination, LocalStorageService, Notifier, SessionStorageService, UserService } from '@app/core'
7import { AuthService, Notifier } from '@app/core' 4import { peertubeLocalStorage, peertubeSessionStorage } from '@app/helpers/peertube-web-storage'
8import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service' 5import { VideoPlaylist, VideoPlaylistElement, VideoPlaylistService } from '@app/shared/shared-video-playlist'
9import { VideoPlaylistElement } from '@app/shared/video-playlist/video-playlist-element.model'
10import { peertubeLocalStorage, peertubeSessionStorage } from '@app/shared/misc/peertube-web-storage'
11import { I18n } from '@ngx-translate/i18n-polyfill' 6import { I18n } from '@ngx-translate/i18n-polyfill'
12import { SessionStorageService, LocalStorageService } from '@app/shared/misc/storage.service' 7import { VideoDetails, VideoPlaylistPrivacy } from '@shared/models'
13 8
14@Component({ 9@Component({
15 selector: 'my-video-watch-playlist', 10 selector: 'my-video-watch-playlist',
diff --git a/client/src/app/videos/+video-watch/video-watch-routing.module.ts b/client/src/app/videos/+video-watch/video-watch-routing.module.ts
index ce9250bdc..d8fecb87d 100644
--- a/client/src/app/videos/+video-watch/video-watch-routing.module.ts
+++ b/client/src/app/videos/+video-watch/video-watch-routing.module.ts
@@ -1,8 +1,6 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3
4import { MetaGuard } from '@ngx-meta/core' 3import { MetaGuard } from '@ngx-meta/core'
5
6import { VideoWatchComponent } from './video-watch.component' 4import { VideoWatchComponent } from './video-watch.component'
7 5
8const videoWatchRoutes: Routes = [ 6const videoWatchRoutes: Routes = [
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts
index df0c1058c..5b0b34c80 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -1,41 +1,33 @@
1import { Hotkey, HotkeysService } from 'angular2-hotkeys'
2import { forkJoin, Observable, Subscription } from 'rxjs'
1import { catchError } from 'rxjs/operators' 3import { catchError } from 'rxjs/operators'
4import { PlatformLocation } from '@angular/common'
2import { ChangeDetectorRef, Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' 5import { ChangeDetectorRef, Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
3import { ActivatedRoute, Router } from '@angular/router' 6import { ActivatedRoute, Router } from '@angular/router'
7import { AuthService, AuthUser, ConfirmService, MarkdownService, Notifier, RestExtractor, ServerService, UserService } from '@app/core'
8import { HooksService } from '@app/core/plugins/hooks.service'
4import { RedirectService } from '@app/core/routing/redirect.service' 9import { RedirectService } from '@app/core/routing/redirect.service'
5import { peertubeLocalStorage } from '@app/shared/misc/peertube-web-storage' 10import { isXPercentInViewport, peertubeLocalStorage, scrollToTop } from '@app/helpers'
6import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' 11import { Video, VideoCaptionService, VideoDetails, VideoService } from '@app/shared/shared-main'
12import { SubscribeButtonComponent } from '@app/shared/shared-user-subscription'
13import { VideoPlaylist, VideoPlaylistService } from '@app/shared/shared-video-playlist'
7import { MetaService } from '@ngx-meta/core' 14import { MetaService } from '@ngx-meta/core'
8import { AuthUser, Notifier, ServerService } from '@app/core'
9import { forkJoin, Observable, Subscription } from 'rxjs'
10import { Hotkey, HotkeysService } from 'angular2-hotkeys'
11import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '../../../../../shared'
12import { AuthService, ConfirmService } from '../../core'
13import { RestExtractor, UserService } from '../../shared'
14import { VideoDetails } from '../../shared/video/video-details.model'
15import { VideoService } from '../../shared/video/video.service'
16import { VideoShareComponent } from './modal/video-share.component'
17import { SubscribeButtonComponent } from '@app/shared/user-subscription/subscribe-button.component'
18import { I18n } from '@ngx-translate/i18n-polyfill' 15import { I18n } from '@ngx-translate/i18n-polyfill'
19import { environment } from '../../../environments/environment' 16import { ServerConfig, UserVideoRateType, VideoCaption, VideoPrivacy, VideoState } from '@shared/models'
20import { VideoCaptionService } from '@app/shared/video-caption' 17import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage'
21import { MarkdownService } from '@app/shared/renderer'
22import { 18import {
23 videojs,
24 CustomizationOptions, 19 CustomizationOptions,
25 P2PMediaLoaderOptions, 20 P2PMediaLoaderOptions,
26 PeertubePlayerManager, 21 PeertubePlayerManager,
27 PeertubePlayerManagerOptions, 22 PeertubePlayerManagerOptions,
28 PlayerMode 23 PlayerMode,
24 videojs
29} from '../../../assets/player/peertube-player-manager' 25} from '../../../assets/player/peertube-player-manager'
30import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
31import { VideoPlaylistService } from '@app/shared/video-playlist/video-playlist.service'
32import { Video } from '@app/shared/video/video.model'
33import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils' 26import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils'
34import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component' 27import { environment } from '../../../environments/environment'
35import { getStoredP2PEnabled, getStoredTheater } from '../../../assets/player/peertube-player-local-storage' 28import { VideoShareComponent } from './modal/video-share.component'
36import { HooksService } from '@app/core/plugins/hooks.service' 29import { VideoSupportComponent } from './modal/video-support.component'
37import { PlatformLocation } from '@angular/common' 30import { VideoWatchPlaylistComponent } from './video-watch-playlist.component'
38import { scrollToTop, isXPercentInViewport } from '@app/shared/misc/utils'
39 31
40@Component({ 32@Component({
41 selector: 'my-video-watch', 33 selector: 'my-video-watch',
diff --git a/client/src/app/videos/+video-watch/video-watch.module.ts b/client/src/app/videos/+video-watch/video-watch.module.ts
index 9b445269d..a1c54f065 100644
--- a/client/src/app/videos/+video-watch/video-watch.module.ts
+++ b/client/src/app/videos/+video-watch/video-watch.module.ts
@@ -1,26 +1,40 @@
1import { QRCodeModule } from 'angularx-qrcode'
1import { NgModule } from '@angular/core' 2import { NgModule } from '@angular/core'
2import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' 3import { SharedFormModule } from '@app/shared/shared-forms'
3import { SharedModule } from '../../shared' 4import { SharedGlobalIconModule } from '@app/shared/shared-icons'
5import { SharedMainModule } from '@app/shared/shared-main'
6import { SharedModerationModule } from '@app/shared/shared-moderation'
7import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription'
8import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
9import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist'
10import { RecommendationsModule } from '@app/videos/recommendations/recommendations.module'
11import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'
4import { VideoCommentAddComponent } from './comment/video-comment-add.component' 12import { VideoCommentAddComponent } from './comment/video-comment-add.component'
5import { VideoCommentComponent } from './comment/video-comment.component' 13import { VideoCommentComponent } from './comment/video-comment.component'
6import { VideoCommentService } from './comment/video-comment.service' 14import { VideoCommentService } from './comment/video-comment.service'
7import { VideoCommentsComponent } from './comment/video-comments.component' 15import { VideoCommentsComponent } from './comment/video-comments.component'
8import { VideoShareComponent } from './modal/video-share.component' 16import { VideoShareComponent } from './modal/video-share.component'
17import { VideoSupportComponent } from './modal/video-support.component'
18import { TimestampRouteTransformerDirective } from './timestamp-route-transformer.directive'
19import { VideoDurationPipe } from './video-duration-formatter.pipe'
20import { VideoWatchPlaylistComponent } from './video-watch-playlist.component'
9import { VideoWatchRoutingModule } from './video-watch-routing.module' 21import { VideoWatchRoutingModule } from './video-watch-routing.module'
10import { VideoWatchComponent } from './video-watch.component' 22import { VideoWatchComponent } from './video-watch.component'
11import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'
12import { RecommendationsModule } from '@app/videos/recommendations/recommendations.module'
13import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component'
14import { QRCodeModule } from 'angularx-qrcode'
15import { TimestampRouteTransformerDirective } from '@app/shared/angular/timestamp-route-transformer.directive'
16 23
17@NgModule({ 24@NgModule({
18 imports: [ 25 imports: [
19 VideoWatchRoutingModule, 26 VideoWatchRoutingModule,
20 SharedModule,
21 NgbTooltipModule, 27 NgbTooltipModule,
22 QRCodeModule, 28 QRCodeModule,
23 RecommendationsModule 29 RecommendationsModule,
30
31 SharedMainModule,
32 SharedFormModule,
33 SharedVideoMiniatureModule,
34 SharedVideoPlaylistModule,
35 SharedUserSubscriptionModule,
36 SharedModerationModule,
37 SharedGlobalIconModule
24 ], 38 ],
25 39
26 declarations: [ 40 declarations: [
@@ -33,6 +47,8 @@ import { TimestampRouteTransformerDirective } from '@app/shared/angular/timestam
33 VideoCommentAddComponent, 47 VideoCommentAddComponent,
34 VideoCommentComponent, 48 VideoCommentComponent,
35 49
50 TimestampRouteTransformerDirective,
51 VideoDurationPipe,
36 TimestampRouteTransformerDirective 52 TimestampRouteTransformerDirective
37 ], 53 ],
38 54
diff --git a/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts b/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts
index 0abf938b7..a376453bf 100644
--- a/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts
+++ b/client/src/app/videos/recommendations/recent-videos-recommendation.service.ts
@@ -1,15 +1,13 @@
1import { Observable, of } from 'rxjs' 1import { Observable, of } from 'rxjs'
2import { map, switchMap } from 'rxjs/operators' 2import { map, switchMap } from 'rxjs/operators'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { ServerService } from '@app/core' 4import { ServerService, UserService } from '@app/core'
5import { AdvancedSearch } from '@app/search/advanced-search.model' 5import { AdvancedSearch } from '@app/search/advanced-search.model'
6import { SearchService } from '@app/search/search.service' 6import { SearchService } from '@app/search/search.service'
7import { UserService } from '@app/shared' 7import { Video, VideoService } from '@app/shared/shared-main'
8import { RecommendationInfo } from '@app/shared/video/recommendation-info.model'
9import { Video } from '@app/shared/video/video.model'
10import { VideoService } from '@app/shared/video/video.service'
11import { RecommendationService } from '@app/videos/recommendations/recommendations.service'
12import { ServerConfig } from '@shared/models' 8import { ServerConfig } from '@shared/models'
9import { RecommendationInfo } from './recommendation-info.model'
10import { RecommendationService } from './recommendations.service'
13 11
14/** 12/**
15 * Provides "recommendations" by providing the most recently uploaded videos. 13 * Provides "recommendations" by providing the most recently uploaded videos.
diff --git a/client/src/app/shared/video/recommendation-info.model.ts b/client/src/app/videos/recommendations/recommendation-info.model.ts
index 0233563bb..0233563bb 100644
--- a/client/src/app/shared/video/recommendation-info.model.ts
+++ b/client/src/app/videos/recommendations/recommendation-info.model.ts
diff --git a/client/src/app/videos/recommendations/recommendations.module.ts b/client/src/app/videos/recommendations/recommendations.module.ts
index 3e279cc29..03cc272ca 100644
--- a/client/src/app/videos/recommendations/recommendations.module.ts
+++ b/client/src/app/videos/recommendations/recommendations.module.ts
@@ -1,16 +1,21 @@
1import { NgModule } from '@angular/core'
2import { InputSwitchModule } from 'primeng/inputswitch' 1import { InputSwitchModule } from 'primeng/inputswitch'
3import { RecommendedVideosComponent } from '@app/videos/recommendations/recommended-videos.component'
4import { RecommendedVideosStore } from '@app/videos/recommendations/recommended-videos.store'
5import { CommonModule } from '@angular/common' 2import { CommonModule } from '@angular/common'
6import { SharedModule } from '@app/shared' 3import { NgModule } from '@angular/core'
7import { RecentVideosRecommendationService } from '@app/videos/recommendations/recent-videos-recommendation.service' 4import { SharedMainModule } from '@app/shared/shared-main'
5import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
6import { SharedVideoPlaylistModule } from '@app/shared/shared-video-playlist'
7import { RecentVideosRecommendationService } from './recent-videos-recommendation.service'
8import { RecommendedVideosComponent } from './recommended-videos.component'
9import { RecommendedVideosStore } from './recommended-videos.store'
8 10
9@NgModule({ 11@NgModule({
10 imports: [ 12 imports: [
13 CommonModule,
11 InputSwitchModule, 14 InputSwitchModule,
12 SharedModule, 15
13 CommonModule 16 SharedMainModule,
17 SharedVideoPlaylistModule,
18 SharedVideoMiniatureModule
14 ], 19 ],
15 declarations: [ 20 declarations: [
16 RecommendedVideosComponent 21 RecommendedVideosComponent
diff --git a/client/src/app/videos/recommendations/recommendations.service.ts b/client/src/app/videos/recommendations/recommendations.service.ts
index a547e289d..1d79d35f6 100644
--- a/client/src/app/videos/recommendations/recommendations.service.ts
+++ b/client/src/app/videos/recommendations/recommendations.service.ts
@@ -1,6 +1,6 @@
1import { Video } from '@app/shared/video/video.model'
2import { RecommendationInfo } from '@app/shared/video/recommendation-info.model'
3import { Observable } from 'rxjs' 1import { Observable } from 'rxjs'
2import { Video } from '@app/shared/shared-main'
3import { RecommendationInfo } from './recommendation-info.model'
4 4
5export interface RecommendationService { 5export interface RecommendationService {
6 getRecommendations (recommendation: RecommendationInfo): Observable<Video[]> 6 getRecommendations (recommendation: RecommendationInfo): Observable<Video[]>
diff --git a/client/src/app/videos/recommendations/recommended-videos.component.ts b/client/src/app/videos/recommendations/recommended-videos.component.ts
index a6f3bce3d..016975341 100644
--- a/client/src/app/videos/recommendations/recommended-videos.component.ts
+++ b/client/src/app/videos/recommendations/recommended-videos.component.ts
@@ -1,15 +1,12 @@
1import { Observable } from 'rxjs' 1import { Observable } from 'rxjs'
2import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core' 2import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'
3import { AuthService, Notifier } from '@app/core' 3import { AuthService, Notifier, SessionStorageService, User, UserService } from '@app/core'
4import { User } from '@app/shared' 4import { Video } from '@app/shared/shared-main'
5import { SessionStorageService } from '@app/shared/misc/storage.service' 5import { MiniatureDisplayOptions } from '@app/shared/shared-video-miniature'
6import { UserService } from '@app/shared/users/user.service' 6import { VideoPlaylist } from '@app/shared/shared-video-playlist'
7import { VideoPlaylist } from '@app/shared/video-playlist/video-playlist.model'
8import { RecommendationInfo } from '@app/shared/video/recommendation-info.model'
9import { MiniatureDisplayOptions } from '@app/shared/video/video-miniature.component'
10import { Video } from '@app/shared/video/video.model'
11import { RecommendedVideosStore } from '@app/videos/recommendations/recommended-videos.store'
12import { I18n } from '@ngx-translate/i18n-polyfill' 7import { I18n } from '@ngx-translate/i18n-polyfill'
8import { RecommendationInfo } from './recommendation-info.model'
9import { RecommendedVideosStore } from './recommended-videos.store'
13 10
14@Component({ 11@Component({
15 selector: 'my-recommended-videos', 12 selector: 'my-recommended-videos',
diff --git a/client/src/app/videos/recommendations/recommended-videos.store.ts b/client/src/app/videos/recommendations/recommended-videos.store.ts
index 858ec3a27..8c3fb6480 100644
--- a/client/src/app/videos/recommendations/recommended-videos.store.ts
+++ b/client/src/app/videos/recommendations/recommended-videos.store.ts
@@ -1,10 +1,10 @@
1import { Inject, Injectable } from '@angular/core'
2import { Observable, ReplaySubject } from 'rxjs' 1import { Observable, ReplaySubject } from 'rxjs'
3import { Video } from '@app/shared/video/video.model'
4import { RecommendationInfo } from '@app/shared/video/recommendation-info.model'
5import { RecentVideosRecommendationService } from '@app/videos/recommendations/recent-videos-recommendation.service'
6import { RecommendationService } from '@app/videos/recommendations/recommendations.service'
7import { map, shareReplay, switchMap, take } from 'rxjs/operators' 2import { map, shareReplay, switchMap, take } from 'rxjs/operators'
3import { Inject, Injectable } from '@angular/core'
4import { Video } from '@app/shared/shared-main'
5import { RecentVideosRecommendationService } from './recent-videos-recommendation.service'
6import { RecommendationInfo } from './recommendation-info.model'
7import { RecommendationService } from './recommendations.service'
8 8
9/** 9/**
10 * This store is intended to provide data for the RecommendedVideosComponent. 10 * This store is intended to provide data for the RecommendedVideosComponent.
@@ -20,7 +20,7 @@ export class RecommendedVideosStore {
20 ) { 20 ) {
21 this.recommendations$ = this.requestsForLoad$$.pipe( 21 this.recommendations$ = this.requestsForLoad$$.pipe(
22 switchMap(requestedRecommendation => { 22 switchMap(requestedRecommendation => {
23 return recommendations.getRecommendations(requestedRecommendation) 23 return this.recommendations.getRecommendations(requestedRecommendation)
24 .pipe(take(1)) 24 .pipe(take(1))
25 }), 25 }),
26 shareReplay() 26 shareReplay()
diff --git a/client/src/app/videos/video-list/index.ts b/client/src/app/videos/video-list/index.ts
index b367110ae..af1bd58b7 100644
--- a/client/src/app/videos/video-list/index.ts
+++ b/client/src/app/videos/video-list/index.ts
@@ -1,3 +1,4 @@
1export * from './overview'
1export * from './video-local.component' 2export * from './video-local.component'
2export * from './video-recently-added.component' 3export * from './video-recently-added.component'
3export * from './video-trending.component' 4export * from './video-trending.component'
diff --git a/client/src/app/videos/video-list/overview/index.ts b/client/src/app/videos/video-list/overview/index.ts
new file mode 100644
index 000000000..e6cfa4802
--- /dev/null
+++ b/client/src/app/videos/video-list/overview/index.ts
@@ -0,0 +1,3 @@
1export * from './overview.service'
2export * from './video-overview.component'
3export * from './videos-overview.model'
diff --git a/client/src/app/shared/overview/overview.service.ts b/client/src/app/videos/video-list/overview/overview.service.ts
index 6d8af8052..4458454d5 100644
--- a/client/src/app/shared/overview/overview.service.ts
+++ b/client/src/app/videos/video-list/overview/overview.service.ts
@@ -1,14 +1,13 @@
1import { forkJoin, Observable, of } from 'rxjs'
1import { catchError, map, switchMap, tap } from 'rxjs/operators' 2import { catchError, map, switchMap, tap } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 3import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 4import { Injectable } from '@angular/core'
4import { forkJoin, Observable, of } from 'rxjs' 5import { RestExtractor, ServerService } from '@app/core'
5import { VideosOverview as VideosOverviewServer, peertubeTranslate } from '../../../../../shared/models' 6import { immutableAssign } from '@app/helpers'
6import { environment } from '../../../environments/environment' 7import { VideoService } from '@app/shared/shared-main'
7import { RestExtractor } from '../rest/rest-extractor.service' 8import { peertubeTranslate, VideosOverview as VideosOverviewServer } from '@shared/models'
8import { VideosOverview } from '@app/shared/overview/videos-overview.model' 9import { environment } from '../../../../environments/environment'
9import { VideoService } from '@app/shared/video/video.service' 10import { VideosOverview } from './videos-overview.model'
10import { ServerService } from '@app/core'
11import { immutableAssign } from '@app/shared/misc/utils'
12 11
13@Injectable() 12@Injectable()
14export class OverviewService { 13export class OverviewService {
diff --git a/client/src/app/videos/video-list/video-overview.component.html b/client/src/app/videos/video-list/overview/video-overview.component.html
index ca986c634..ca986c634 100644
--- a/client/src/app/videos/video-list/video-overview.component.html
+++ b/client/src/app/videos/video-list/overview/video-overview.component.html
diff --git a/client/src/app/videos/video-list/video-overview.component.scss b/client/src/app/videos/video-list/overview/video-overview.component.scss
index c1d10188a..c1d10188a 100644
--- a/client/src/app/videos/video-list/video-overview.component.scss
+++ b/client/src/app/videos/video-list/overview/video-overview.component.scss
diff --git a/client/src/app/videos/video-list/video-overview.component.ts b/client/src/app/videos/video-list/overview/video-overview.component.ts
index 8ff8400db..b3be1d7b5 100644
--- a/client/src/app/videos/video-list/video-overview.component.ts
+++ b/client/src/app/videos/video-list/overview/video-overview.component.ts
@@ -1,11 +1,9 @@
1import { Subject } from 'rxjs' 1import { Subject } from 'rxjs'
2import { Component, OnInit } from '@angular/core' 2import { Component, OnInit } from '@angular/core'
3import { Notifier } from '@app/core' 3import { Notifier, ScreenService, User, UserService } from '@app/core'
4import { User, UserService } from '@app/shared' 4import { Video } from '@app/shared/shared-main'
5import { ScreenService } from '@app/shared/misc/screen.service' 5import { OverviewService } from './overview.service'
6import { OverviewService } from '@app/shared/overview' 6import { VideosOverview } from './videos-overview.model'
7import { VideosOverview } from '@app/shared/overview/videos-overview.model'
8import { Video } from '@app/shared/video/video.model'
9 7
10@Component({ 8@Component({
11 selector: 'my-video-overview', 9 selector: 'my-video-overview',
diff --git a/client/src/app/shared/overview/videos-overview.model.ts b/client/src/app/videos/video-list/overview/videos-overview.model.ts
index 21abe1697..6765ad9b7 100644
--- a/client/src/app/shared/overview/videos-overview.model.ts
+++ b/client/src/app/videos/video-list/overview/videos-overview.model.ts
@@ -1,5 +1,5 @@
1import { VideoChannelSummary, VideoConstant, VideosOverview as VideosOverviewServer } from '../../../../../shared/models' 1import { Video } from '@app/shared/shared-main'
2import { Video } from '@app/shared/video/video.model' 2import { VideoChannelSummary, VideoConstant, VideosOverview as VideosOverviewServer } from '@shared/models'
3 3
4export class VideosOverview implements VideosOverviewServer { 4export class VideosOverview implements VideosOverviewServer {
5 channels: { 5 channels: {
diff --git a/client/src/app/videos/video-list/video-local.component.ts b/client/src/app/videos/video-list/video-local.component.ts
index 960523cd7..b4c71ac49 100644
--- a/client/src/app/videos/video-list/video-local.component.ts
+++ b/client/src/app/videos/video-list/video-local.component.ts
@@ -1,23 +1,17 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils' 3import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
4import { AuthService } from '../../core/auth'
5import { AbstractVideoList } from '../../shared/video/abstract-video-list'
6import { VideoSortField } from '../../shared/video/sort-field.type'
7import { VideoService } from '../../shared/video/video.service'
8import { VideoFilter } from '../../../../../shared/models/videos/video-query.type'
9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { ScreenService } from '@app/shared/misc/screen.service'
11import { UserRight } from '../../../../../shared/models/users'
12import { Notifier, ServerService } from '@app/core'
13import { HooksService } from '@app/core/plugins/hooks.service' 4import { HooksService } from '@app/core/plugins/hooks.service'
14import { UserService } from '@app/shared' 5import { immutableAssign } from '@app/helpers'
15import { LocalStorageService } from '@app/shared/misc/storage.service' 6import { VideoService } from '@app/shared/shared-main'
7import { AbstractVideoList } from '@app/shared/shared-video-miniature'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { UserRight, VideoFilter, VideoSortField } from '@shared/models'
16 10
17@Component({ 11@Component({
18 selector: 'my-videos-local', 12 selector: 'my-videos-local',
19 styleUrls: [ '../../shared/video/abstract-video-list.scss' ], 13 styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ],
20 templateUrl: '../../shared/video/abstract-video-list.html' 14 templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html'
21}) 15})
22export class VideoLocalComponent extends AbstractVideoList implements OnInit, OnDestroy { 16export class VideoLocalComponent extends AbstractVideoList implements OnInit, OnDestroy {
23 titlePage: string 17 titlePage: string
diff --git a/client/src/app/videos/video-list/video-most-liked.component.ts b/client/src/app/videos/video-list/video-most-liked.component.ts
index cc91a2330..ca14851bb 100644
--- a/client/src/app/videos/video-list/video-most-liked.component.ts
+++ b/client/src/app/videos/video-list/video-most-liked.component.ts
@@ -1,21 +1,17 @@
1import { Component, OnInit } from '@angular/core' 1import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils' 3import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
4import { AuthService } from '../../core/auth'
5import { AbstractVideoList } from '../../shared/video/abstract-video-list'
6import { VideoSortField } from '../../shared/video/sort-field.type'
7import { VideoService } from '../../shared/video/video.service'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { ScreenService } from '@app/shared/misc/screen.service'
10import { Notifier, ServerService } from '@app/core'
11import { HooksService } from '@app/core/plugins/hooks.service' 4import { HooksService } from '@app/core/plugins/hooks.service'
12import { UserService } from '@app/shared' 5import { immutableAssign } from '@app/helpers'
13import { LocalStorageService } from '@app/shared/misc/storage.service' 6import { VideoService } from '@app/shared/shared-main'
7import { AbstractVideoList } from '@app/shared/shared-video-miniature'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { VideoSortField } from '@shared/models'
14 10
15@Component({ 11@Component({
16 selector: 'my-videos-most-liked', 12 selector: 'my-videos-most-liked',
17 styleUrls: [ '../../shared/video/abstract-video-list.scss' ], 13 styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ],
18 templateUrl: '../../shared/video/abstract-video-list.html' 14 templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html'
19}) 15})
20export class VideoMostLikedComponent extends AbstractVideoList implements OnInit { 16export class VideoMostLikedComponent extends AbstractVideoList implements OnInit {
21 titlePage: string 17 titlePage: string
diff --git a/client/src/app/videos/video-list/video-recently-added.component.ts b/client/src/app/videos/video-list/video-recently-added.component.ts
index 9f57a61e3..c9395133f 100644
--- a/client/src/app/videos/video-list/video-recently-added.component.ts
+++ b/client/src/app/videos/video-list/video-recently-added.component.ts
@@ -1,21 +1,17 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils' 3import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
4import { AuthService } from '../../core/auth'
5import { AbstractVideoList } from '../../shared/video/abstract-video-list'
6import { VideoSortField } from '../../shared/video/sort-field.type'
7import { VideoService } from '../../shared/video/video.service'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { ScreenService } from '@app/shared/misc/screen.service'
10import { Notifier, ServerService } from '@app/core'
11import { HooksService } from '@app/core/plugins/hooks.service' 4import { HooksService } from '@app/core/plugins/hooks.service'
12import { UserService } from '@app/shared' 5import { immutableAssign } from '@app/helpers'
13import { LocalStorageService } from '@app/shared/misc/storage.service' 6import { VideoService } from '@app/shared/shared-main'
7import { AbstractVideoList } from '@app/shared/shared-video-miniature'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { VideoSortField } from '@shared/models'
14 10
15@Component({ 11@Component({
16 selector: 'my-videos-recently-added', 12 selector: 'my-videos-recently-added',
17 styleUrls: [ '../../shared/video/abstract-video-list.scss' ], 13 styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ],
18 templateUrl: '../../shared/video/abstract-video-list.html' 14 templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html'
19}) 15})
20export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy { 16export class VideoRecentlyAddedComponent extends AbstractVideoList implements OnInit, OnDestroy {
21 titlePage: string 17 titlePage: string
diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts
index 62e0f4e69..10eab18de 100644
--- a/client/src/app/videos/video-list/video-trending.component.ts
+++ b/client/src/app/videos/video-list/video-trending.component.ts
@@ -1,21 +1,17 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils' 3import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
4import { AuthService } from '../../core/auth'
5import { AbstractVideoList } from '../../shared/video/abstract-video-list'
6import { VideoSortField } from '../../shared/video/sort-field.type'
7import { VideoService } from '../../shared/video/video.service'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { ScreenService } from '@app/shared/misc/screen.service'
10import { Notifier, ServerService } from '@app/core'
11import { HooksService } from '@app/core/plugins/hooks.service' 4import { HooksService } from '@app/core/plugins/hooks.service'
12import { UserService } from '@app/shared' 5import { immutableAssign } from '@app/helpers'
13import { LocalStorageService } from '@app/shared/misc/storage.service' 6import { VideoService } from '@app/shared/shared-main'
7import { AbstractVideoList } from '@app/shared/shared-video-miniature'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { VideoSortField } from '@shared/models'
14 10
15@Component({ 11@Component({
16 selector: 'my-videos-trending', 12 selector: 'my-videos-trending',
17 styleUrls: [ '../../shared/video/abstract-video-list.scss' ], 13 styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ],
18 templateUrl: '../../shared/video/abstract-video-list.html' 14 templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html'
19}) 15})
20export class VideoTrendingComponent extends AbstractVideoList implements OnInit, OnDestroy { 16export class VideoTrendingComponent extends AbstractVideoList implements OnInit, OnDestroy {
21 titlePage: string 17 titlePage: string
diff --git a/client/src/app/videos/video-list/video-user-subscriptions.component.ts b/client/src/app/videos/video-list/video-user-subscriptions.component.ts
index 036fd8dcb..41ad9b277 100644
--- a/client/src/app/videos/video-list/video-user-subscriptions.component.ts
+++ b/client/src/app/videos/video-list/video-user-subscriptions.component.ts
@@ -1,22 +1,18 @@
1import { Component, OnDestroy, OnInit } from '@angular/core' 1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils' 3import { AuthService, LocalStorageService, Notifier, ScreenService, ServerService, UserService } from '@app/core'
4import { AuthService } from '../../core/auth'
5import { AbstractVideoList } from '../../shared/video/abstract-video-list'
6import { VideoSortField } from '../../shared/video/sort-field.type'
7import { VideoService } from '../../shared/video/video.service'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { ScreenService } from '@app/shared/misc/screen.service'
10import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
11import { Notifier, ServerService } from '@app/core'
12import { HooksService } from '@app/core/plugins/hooks.service' 4import { HooksService } from '@app/core/plugins/hooks.service'
13import { UserService } from '@app/shared' 5import { immutableAssign } from '@app/helpers'
14import { LocalStorageService } from '@app/shared/misc/storage.service' 6import { VideoService } from '@app/shared/shared-main'
7import { UserSubscriptionService } from '@app/shared/shared-user-subscription'
8import { AbstractVideoList, OwnerDisplayType } from '@app/shared/shared-video-miniature'
9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { VideoSortField } from '@shared/models'
15 11
16@Component({ 12@Component({
17 selector: 'my-videos-user-subscriptions', 13 selector: 'my-videos-user-subscriptions',
18 styleUrls: [ '../../shared/video/abstract-video-list.scss' ], 14 styleUrls: [ '../../shared/shared-video-miniature/abstract-video-list.scss' ],
19 templateUrl: '../../shared/video/abstract-video-list.html' 15 templateUrl: '../../shared/shared-video-miniature/abstract-video-list.html'
20}) 16})
21export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy { 17export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy {
22 titlePage: string 18 titlePage: string
@@ -34,6 +30,7 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
34 protected userService: UserService, 30 protected userService: UserService,
35 protected screenService: ScreenService, 31 protected screenService: ScreenService,
36 protected storageService: LocalStorageService, 32 protected storageService: LocalStorageService,
33 private userSubscription: UserSubscriptionService,
37 private videoService: VideoService, 34 private videoService: VideoService,
38 private hooks: HooksService 35 private hooks: HooksService
39 ) { 36 ) {
@@ -64,7 +61,7 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
64 } 61 }
65 62
66 return this.hooks.wrapObsFun( 63 return this.hooks.wrapObsFun(
67 this.videoService.getUserSubscriptionVideos.bind(this.videoService), 64 this.userSubscription.getUserSubscriptionVideos.bind(this.userSubscription),
68 params, 65 params,
69 'common', 66 'common',
70 'filter:api.user-subscriptions-videos.videos.list.params', 67 'filter:api.user-subscriptions-videos.videos.list.params',
diff --git a/client/src/app/videos/videos-routing.module.ts b/client/src/app/videos/videos-routing.module.ts
index 11a087d0a..16b65be63 100644
--- a/client/src/app/videos/videos-routing.module.ts
+++ b/client/src/app/videos/videos-routing.module.ts
@@ -6,8 +6,8 @@ import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.c
6import { VideoTrendingComponent } from './video-list/video-trending.component' 6import { VideoTrendingComponent } from './video-list/video-trending.component'
7import { VideoMostLikedComponent } from './video-list/video-most-liked.component' 7import { VideoMostLikedComponent } from './video-list/video-most-liked.component'
8import { VideosComponent } from './videos.component' 8import { VideosComponent } from './videos.component'
9import { VideoUserSubscriptionsComponent } from '@app/videos/video-list/video-user-subscriptions.component' 9import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
10import { VideoOverviewComponent } from '@app/videos/video-list/video-overview.component' 10import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
11 11
12const videosRoutes: Routes = [ 12const videosRoutes: Routes = [
13 { 13 {
diff --git a/client/src/app/videos/videos.module.ts b/client/src/app/videos/videos.module.ts
index 95078a734..217e5bb50 100644
--- a/client/src/app/videos/videos.module.ts
+++ b/client/src/app/videos/videos.module.ts
@@ -1,18 +1,27 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { VideoLocalComponent } from '@app/videos/video-list/video-local.component' 2import { SharedFormModule } from '@app/shared/shared-forms'
3import { SharedModule } from '../shared' 3import { SharedGlobalIconModule } from '@app/shared/shared-icons'
4import { SharedMainModule } from '@app/shared/shared-main'
5import { SharedUserSubscriptionModule } from '@app/shared/shared-user-subscription'
6import { SharedVideoMiniatureModule } from '@app/shared/shared-video-miniature'
7import { VideoOverviewComponent } from './video-list/overview/video-overview.component'
8import { VideoLocalComponent } from './video-list/video-local.component'
9import { VideoMostLikedComponent } from './video-list/video-most-liked.component'
4import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component' 10import { VideoRecentlyAddedComponent } from './video-list/video-recently-added.component'
5import { VideoTrendingComponent } from './video-list/video-trending.component' 11import { VideoTrendingComponent } from './video-list/video-trending.component'
6import { VideoMostLikedComponent } from './video-list/video-most-liked.component' 12import { VideoUserSubscriptionsComponent } from './video-list/video-user-subscriptions.component'
7import { VideosRoutingModule } from './videos-routing.module' 13import { VideosRoutingModule } from './videos-routing.module'
8import { VideosComponent } from './videos.component' 14import { VideosComponent } from './videos.component'
9import { VideoUserSubscriptionsComponent } from '@app/videos/video-list/video-user-subscriptions.component'
10import { VideoOverviewComponent } from '@app/videos/video-list/video-overview.component'
11 15
12@NgModule({ 16@NgModule({
13 imports: [ 17 imports: [
14 VideosRoutingModule, 18 VideosRoutingModule,
15 SharedModule 19
20 SharedMainModule,
21 SharedFormModule,
22 SharedVideoMiniatureModule,
23 SharedUserSubscriptionModule,
24 SharedGlobalIconModule
16 ], 25 ],
17 26
18 declarations: [ 27 declarations: [