MCPcopy Create free account

hub / github.com/ShukeBta/MediaStationGo / functions

Functions5,617 in github.com/ShukeBta/MediaStationGo

↓ 1,671 callersMethodContext
Context is canceled when the service container is closing.
internal/service/service.go:134
↓ 827 callersMethodError
()
internal/service/sse_hub.go:219
↓ 535 callersMethodSet
(key string, page int, items []ExternalMediaResult)
internal/service/discover_section_cache.go:46
↓ 526 callersMethodCreate
Create produces a new hot backup via "VACUUM INTO".
internal/service/backup.go:69
↓ 328 callersMethodClose
Close 释放 services 持有的任何资源(websocket hub, ffmpeg 转码, fsnotify, 后台轮询器)。
internal/service/service.go:161
↓ 268 callersFunctionNew
New 将每个 repository 连接到单个 *gorm.DB。
internal/repository/repository.go:40
↓ 261 callersMethodWrite
(p []byte)
cmd/server/log_rotate.go:55
↓ 241 callersMethodGet
Get returns the public view for a single provider, or nil.
internal/service/api_config.go:94
↓ 189 callersFunctionnewServiceTestDB
(t *testing.T, models ...any)
internal/service/test_db_test.go:11
↓ 188 callersMethodUnlock
()
internal/database/sqlite_runtime.go:72
↓ 180 callersMethodFindByID
FindByID returns a single site or nil.
internal/service/site_crud.go:41
↓ 178 callersFunctionNewHub
NewHub builds a Hub. Caller must invoke Run in its own goroutine.
internal/service/ws_hub.go:37
↓ 169 callersMethodLock
(ctx context.Context)
internal/database/sqlite_runtime.go:55
↓ 162 callersMethodAdd
(path string, media *model.Media)
internal/service/scanner_local_write_batch.go:33
↓ 145 callersMethodSet
Set upserts a setting value.
internal/repository/setting_repository.go:27
↓ 122 callersMethodList
List returns the entries under dirID. An empty dirID means the root.
internal/service/cloud/cloud.go:67
↓ 121 callersMethodGet
Get 返回指定通知渠道详情。
internal/handler/notify_handler.go:98
↓ 110 callersFunctionwriteOrgFile
(t *testing.T, path, content string)
internal/service/organizer_directory_test.go:13
↓ 101 callersMethodFind
Find returns the device row for (user, device), or (nil, nil) when absent.
internal/repository/bot_repo.go:104
↓ 101 callersMethodget
(ctx context.Context, key string)
internal/service/notifier.go:54
↓ 97 callersFunctioncategoryName
(categories map[string]string, key, fallback string)
internal/service/media_classifier_helpers.go:86
↓ 93 callersMethodSetDefault
SetDefault sets a specific client as default and clears others.
internal/repository/download_client_repo.go:89
↓ 89 callersMethodCount
Count returns the total number of non-deleted users.
internal/repository/user_repository.go:81
↓ 85 callersMethodCreate
Create 创建新的通知渠道。
internal/handler/notify_handler.go:44
↓ 85 callersFunctionNewOrganizerService
NewOrganizerService is the constructor.
internal/service/organizer.go:39
↓ 84 callersMethodpost
(ctx context.Context, path string, payload any, out any)
internal/handler/license_client.go:63
↓ 80 callersFunctionnewOrganizerTestRepo
(t *testing.T)
internal/service/organizer_transfer_test.go:16
↓ 73 callersFunctionParseCloudLibraryMount
(raw string)
internal/service/cloud_mount.go:48
↓ 67 callersFunctionepisodeKey
(season, episode int)
internal/service/local_availability.go:151
↓ 64 callersMethodStatus
Status resolves live database-backed AI config for the UI.
internal/service/ai.go:72
↓ 61 callersFunctionNewDownloadService
NewDownloadService is the constructor.
internal/service/downloads.go:88
↓ 58 callersFunctiononChange
(key: string, value: string)
web/src/pages/SettingsPage.tsx:44
↓ 57 callersMethodexecuteCommand
executeCommand parses and dispatches Telegram commands through a registry so adding a command does not grow a monolithic switch.
internal/service/telegram_commands.go:193
↓ 56 callersMethodOrganizeDirectory
OrganizeDirectory organizes every video file found under opts.SourcePath into the destination root, applying dedup + 洗版 (resolution replacement).
internal/service/organizer_directory.go:39
↓ 56 callersMethodUpsert
Upsert 创建或更新 API 配置,自动加密敏感字段。
internal/service/api_config_svc.go:72
↓ 53 callersMethodScanLibrary
ScanLibrary walks the library root and persists discovered media files.
internal/service/scanner_scan.go:16
↓ 50 callersFunctionNewScannerService
NewScannerService is the constructor.
internal/service/scanner.go:87
↓ 48 callersMethodDelete
Delete removes a single backup file.
internal/service/backup.go:127
↓ 47 callersFunctionfirstNonEmpty
(values ...string)
internal/service/download_views.go:190
↓ 47 callersFunctionreadSTRM
(t *testing.T, path string)
internal/service/strm_svc_test.go:497
↓ 46 callersFunctionBuildCloudLibraryPath
(provider, scanDir, displayDir string)
internal/service/cloud_mount.go:27
↓ 45 callersFunctionAdminRequired
AdminRequired must run AFTER AuthRequired; it enforces role == "admin".
internal/middleware/roles.go:10
↓ 45 callersFunctionNewSTRMService
NewSTRMService 创建 STRM 服务。
internal/service/strm_svc.go:31
↓ 43 callersFunctionnewBotTestService
(t *testing.T)
internal/service/bot_features_test.go:14
↓ 42 callersFunctionselectSiteSearchCandidates
(results []SearchResult, sub *model.Subscription, seenSet map[string]struct{}, availability ...LocalAvailabili
internal/service/subscription_planner.go:41
↓ 41 callersFunctionrequirePermission
(svc *service.Container, key string)
internal/handler/permissions.go:19
↓ 41 callersFunctionsanitizeFilename
sanitizeFilename removes characters not safe for filesystem names.
internal/service/organizer_paths.go:9
↓ 40 callersFunctionNewScraperService
NewScraperService is the constructor.
internal/service/scraper_service.go:31
↓ 40 callersMethodRemove
Remove 移除指定下载任务,deleteFiles 控制是否同时删除文件。
internal/service/download_adapter.go:25
↓ 39 callersFunctionnormalizeOrganizeMediaType
(mediaType string)
internal/service/organizer_directory_source.go:120
↓ 37 callersMethodRun
Run is the blocking event loop. Publish events with Hub.Publish.
internal/service/ws_hub.go:47
↓ 37 callersFunctionparseBoolSetting
(value string, fallback bool)
internal/service/runtime_settings.go:118
↓ 37 callersFunctiontoString
toString converts a gin context value to a string, returning an empty string when the value is missing or of the wrong type.
internal/handler/util.go:6
↓ 36 callersFunctionNewCryptoService
NewCryptoService derives a 256-bit key from the given secret via SHA-256 and constructs an AES-GCM AEAD. Empty secrets yield a service whose Encrypt/D
internal/service/crypto.go:40
↓ 35 callersFunctionNewSubscriptionService
NewSubscriptionService is the constructor.
internal/service/subscription.go:48
↓ 35 callersFunctionNewTMDbProvider
NewTMDbProvider is the constructor. APIBase / image CDN can be overridden via secrets.tmdb_api_proxy + tmdb_image_proxy for users behind GFW. apiConfi
internal/service/tmdb.go:44
↓ 35 callersFunctionpathWithin
(path, root string)
internal/service/organizer_paths.go:158
↓ 35 callersFunctionregisterEmbyRoutes
registerEmbyRoutes 在 r 上挂双前缀("" + "/emby")的 Emby 兼容路由。
internal/handler/emby_routes.go:13
↓ 34 callersFunctionNewMediaService
NewMediaService is the constructor.
internal/service/media.go:53
↓ 34 callersMethodRegister
Register creates a new user. The first registered user is auto-promoted to admin to support fresh installs that did not run SeedAdmin.
internal/service/auth.go:88
↓ 32 callersMethodGenerateFromTree
(ctx context.Context, opts GenerateSTRMTreeOptions)
internal/service/strm_tree_import.go:58
↓ 32 callersFunctionembyEmptyItemsHandler
(_ *service.Container)
internal/handler/emby_static.go:104
↓ 31 callersFunctionset
(key: keyof typeof form, value: string | boolean)
web/src/components/MetadataEditDialog.tsx:78
↓ 30 callersFunctionNewImageProxy
NewImageProxy is the constructor.
internal/service/image_proxy.go:51
↓ 30 callersFunctionnormalizeOrganizeCategoryKey
(value string)
internal/service/organizer_library_classification.go:113
↓ 29 callersMethodItems
Items paginates media in Emby's hierarchy. Episodic libraries are exposed as Series -> Season -> Episode so Infuse/Vidhub/SenPlayer stop treating ever
internal/service/emby_compat.go:133
↓ 29 callersFunctioncontainsAnyText
(text string, needles ...string)
internal/service/media_classifier_helpers.go:29
↓ 28 callersMethodEnabled
Enabled reports whether the AI integration is configured.
internal/service/ai.go:55
↓ 28 callersMethodUpdate
Update 更新 STRM 记录。
internal/service/strm_svc.go:110
↓ 28 callersFunctionconfirmAction
(options: ConfirmOptions)
web/src/components/confirmAction.tsx:5
↓ 28 callersMethodnow
()
internal/service/device_service.go:266
↓ 28 callersFunctionsignedTestToken
(t *testing.T, secret string)
internal/handler/emby_test_helpers_test.go:12
↓ 27 callersMethodAddDownloadWithMeta
(ctx context.Context, userID, urlStr, savePath string, meta DownloadTaskMeta)
internal/service/download_add.go:44
↓ 27 callersMethodPublish
Publish sends an event to every interested subscriber. Non-blocking: the event is dropped if the hub is full to avoid stalling the producer.
internal/service/ws_hub.go:75
↓ 27 callersFunctionmediaVisibilityForRequest
(c *gin.Context, svc *service.Container)
internal/handler/visibility.go:19
↓ 26 callersFunctionCleanQuery
CleanQuery converts a filename like "Inception.2010.1080p.BluRay.x264.mkv" into a TMDb-friendly title plus an optional year hint.
internal/service/scraper_query_clean.go:70
↓ 26 callersFunctionError
Error 返回错误响应。
internal/handler/response.go:55
↓ 26 callersFunctionNewEmbyService
NewEmbyService is the constructor.
internal/service/emby_compat.go:75
↓ 26 callersFunctionParseEpisode
ParseEpisode tries to extract (season, episode) from an arbitrary filename. Returns (0, 0) when nothing recognisable is found.
internal/service/episode_parser.go:43
↓ 26 callersFunctionescapeHTML
(s string)
internal/service/notifier.go:142
↓ 26 callersFunctionnewTestEmbyService
(t *testing.T)
internal/service/emby_compat_test.go:16
↓ 26 callersFunctionnormalizeMediaType
(mediaType, title, category string)
internal/service/media_classifier.go:164
↓ 26 callersFunctionresolveMappedDestinationPath
(path string)
internal/service/media_paths.go:128
↓ 26 callersFunctionstrr
strr is a tiny helper to avoid importing fmt.Sprint just to coerce interface{} → string. (Named "strr" so it doesn't collide with the notify channel's
internal/service/storage_config.go:243
↓ 25 callersFunctionCloudLibraryAutoCategory
(lib model.Library)
internal/service/cloud_auto_category.go:31
↓ 25 callersMethodSetScraper
SetScraper wires the scraper so directory organize can resolve TMDb/Bangumi metadata before it decides the final folder and filename.
internal/service/organizer.go:50
↓ 25 callersFunctionfirstQueryValue
(c *gin.Context, keys ...string)
internal/handler/emby_auth_request.go:167
↓ 25 callersFunctionnewTestScraper
(t *testing.T)
internal/service/scraper_test_helpers_test.go:28
↓ 25 callersFunctionnfoPath
(media string)
internal/service/nfo.go:116
↓ 25 callersMethodtelegramBinding
(ctx context.Context, telegramUserID int)
internal/service/telegram_binding.go:13
↓ 24 callersFunctionNew
New constructs a provider of the given type from a free-form config map (as persisted by StorageConfigService). The client is shared so callers can in
internal/service/cloud/cloud.go:91
↓ 24 callersFunctionNewStorageConfigService
NewStorageConfigService is the constructor.
internal/service/storage_config.go:36
↓ 24 callersMethodSave
Save persists the user permission patch (admin only — caller checks).
internal/service/permission.go:118
↓ 24 callersMethodSetStorageConfig
SetStorageConfig wires cloud-disk storage access into the scanner. It is set after service construction because StorageConfigService depends on Crypto
internal/service/scanner.go:115
↓ 24 callersFunctionmediaSeriesKey
(media model.Media)
internal/service/media_series_key.go:14
↓ 23 callersMethodSave
Save inserts or updates the config row.
internal/service/storage_config.go:107
↓ 23 callersFunctionnewAuthTestServices
(t *testing.T)
internal/service/auth_user_limits_test.go:22
↓ 22 callersFunctionAllModels
AllModels returns the slice consumed by gorm.AutoMigrate.
internal/model/model.go:33
↓ 22 callersFunctioncleanXMLText
(value string)
internal/service/local_metadata_helpers.go:41
↓ 22 callersFunctionstr
str coerces a config value to a trimmed string.
internal/service/cloud/cloud.go:113
next →1–100 of 5,617, ranked by callers