diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 01e5ffd6..2b2443b2 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -3,22 +3,6 @@ name: code check on: [push, pull_request] jobs: - doc: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.12'] - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: Run pre-commit - run: | - python -m pip install mkdocs-material - mkdocs build -s -d /tmp/neodb-docs lint: runs-on: ubuntu-latest strategy: diff --git a/FEDERATION.md b/FEDERATION.md index 8f93139f..22289e5b 100644 --- a/FEDERATION.md +++ b/FEDERATION.md @@ -1,3 +1,3 @@ # Federation -see [doc](docs/internals/federation.md) for FEP-67ff related information. +see [doc](https://neodb.net/internals/federation.md) for FEP-67ff related information. diff --git a/README.md b/README.md index cfc1269c..5ad6b863 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,21 @@ [![Docker Pulls](https://img.shields.io/docker/pulls/neodb/neodb?label=docker&color=3791E0&style=for-the-badge)](https://hub.docker.com/r/neodb/neodb) [![GitHub License](https://img.shields.io/github/license/neodb-social/neodb?color=E69A48&style=for-the-badge)](https://github.com/neodb-social/neodb/blob/main/LICENSE) + # 🧩 NeoDB _mark the things you love._ [NeoDB](https://neodb.net) (fka boofilsic) is an open source project and free service to help users manage, share and discover collections, reviews and ratings for culture products (e.g. books, movies, music, podcasts, games and performances) in Fediverse. -[NeoDB.social](https://neodb.social) is a free instance hosted by NeoDB developers, there are more [servers](https://neodb.net/servers/) and [apps](https://neodb.net/apps/) available. Your support is essential to keep them free and open-sourced. +[NeoDB.social](https://neodb.social) is a free instance hosted by NeoDB developers, there are more [servers](https://neodb.net/servers/) and [apps](https://neodb.net/apps/) available. -Follow us on [Fediverse](https://mastodon.online/@neodb), [Bluesky](https://bsky.app/profile/neodb.net) or join our [Discord community](https://discord.gg/QBHkrV8bxK) to share your ideas/questions/creations. +Follow us on [Fediverse](https://mastodon.online/@neodb), [Bluesky](https://bsky.app/profile/neodb.net) or join our [Discord community](https://discord.gg/QBHkrV8bxK) to share your ideas/questions/creations. Your support is essential to keep the services free and open-sourced. [![Mastodon](https://img.shields.io/mastodon/follow/106919732872456302?style=for-the-badge&logo=mastodon&logoColor=fff&label=%40neodb%40mastodon.social&color=6D75D2)](https://mastodon.social/@neodb) [![Discord](https://img.shields.io/discord/1041738638364528710?label=Discord&logo=discord&logoColor=fff&color=6D75D2&style=for-the-badge)](https://discord.gg/QBHkrV8bxK) [![Kofi](https://img.shields.io/badge/Ko--Fi-Donate-orange?label=Support%20NeoDB%20on%20Ko-fi&style=for-the-badge&color=ff5f5f&logo=ko-fi)](https://ko-fi.com/neodb) + ## Features - Manage a shared catalog of books/movies/tv shows/music album/games/podcasts/performances + search or create catalog items in each category @@ -66,13 +68,17 @@ Follow us on [Fediverse](https://mastodon.online/@neodb), [Bluesky](https://bsky - Other + i18n: English, Danish and Simp/Trad Chinese available; contribution for more languages welcomed + ## Host your own instance -Please see [docs/install.md](docs/install.md) +Please see [installation guide](https://neodb.net/install/). + ## Contribution - To build application with NeoDB API, documentation is available in [NeoDB API Developer Console](https://neodb.social/developer/) - - To help develop NeoDB, please see [docs/development.md](docs/development.md) for some basics to start with + - To help develop NeoDB, please see [development guide](https://neodb.net/development/) for some basics to start with - To translate NeoDB to more languages, please join [our project on Weblate](https://hosted.weblate.org/projects/neodb/neodb/) + - Source code for [NeoDB documentation](https://neodb.net) can be found [here](https://github.com/neodb-social/neodb-doc) + ## Sponsor If you like this project, please consider donating to [NeoDB.social on ko-fi](https://ko-fi.com/neodb), or [Takahē](https://www.patreon.com/takahe) and [NiceDB](https://patreon.com/tertius) without whom this project won't be possible. diff --git a/boofilsic/settings.py b/boofilsic/settings.py index 04b1df5f..3f74a9cb 100644 --- a/boofilsic/settings.py +++ b/boofilsic/settings.py @@ -449,6 +449,7 @@ LANGUAGE_CODE, PREFERRED_LANGUAGES = _init_language_settings( if TESTING: # force en if testing LANGUAGE_CODE = "en" + PREFERRED_LANGUAGES = ["en"] LOCALE_PATHS = [os.path.join(BASE_DIR, "locale")] @@ -580,7 +581,7 @@ SEARCH_INDEX_NEW_ONLY = False INDEX_ALIASES = env("INDEX_ALIASES") -DOWNLOADER_SAVEDIR = env("NEODB_DOWNLOADER_SAVE_DIR", default="/tmp") # type: ignore +DOWNLOADER_SAVEDIR = env("NEODB_DOWNLOADER_SAVE_DIR", default="") # type: ignore DISABLE_MODEL_SIGNAL = False # disable index and social feeds during importing/etc diff --git a/catalog/common/models.py b/catalog/common/models.py index a6201474..07d02f72 100644 --- a/catalog/common/models.py +++ b/catalog/common/models.py @@ -771,22 +771,22 @@ class Item(PolymorphicModel): return not self.is_deleted and self.merged_to_item is None @cached_property - def rating(self): + def rating_info(self): from journal.models import Rating - return Rating.get_rating_for_item(self) + return Rating.get_info_for_item(self) + + @property + def rating(self): + return self.rating_info.get("average") @cached_property def rating_count(self): - from journal.models import Rating - - return Rating.get_rating_count_for_item(self) + return self.rating_info.get("count") @cached_property def rating_distribution(self): - from journal.models import Rating - - return Rating.get_rating_distribution_for_item(self) + return self.rating_info.get("distribution") @cached_property def tags(self): diff --git a/catalog/music/tests.py b/catalog/music/tests.py index 0bfd8a98..d489fe7a 100644 --- a/catalog/music/tests.py +++ b/catalog/music/tests.py @@ -6,6 +6,8 @@ from catalog.music.utils import * class BasicMusicTest(TestCase): + databases = "__all__" + def test_gtin(self): self.assertIsNone(upc_to_gtin_13("018771208112X")) self.assertIsNone(upc_to_gtin_13("999018771208112")) @@ -15,6 +17,8 @@ class BasicMusicTest(TestCase): class SpotifyTestCase(TestCase): + databases = "__all__" + def test_parse(self): t_id_type = IdType.Spotify_Album t_id_value = "65KwtzkJXw7oT819NFWmEP" @@ -48,6 +52,8 @@ class SpotifyTestCase(TestCase): class DoubanMusicTestCase(TestCase): + databases = "__all__" + def test_parse(self): t_id_type = IdType.DoubanMusic t_id_value = "33551231" @@ -74,6 +80,8 @@ class DoubanMusicTestCase(TestCase): class MultiMusicSitesTestCase(TestCase): + databases = "__all__" + @use_local_response def test_albums(self): url1 = "https://music.douban.com/subject/33551231/" @@ -92,6 +100,8 @@ class MultiMusicSitesTestCase(TestCase): class BandcampTestCase(TestCase): + databases = "__all__" + def test_parse(self): t_id_type = IdType.Bandcamp t_id_value = "intlanthem.bandcamp.com/album/in-these-times" @@ -119,6 +129,8 @@ class BandcampTestCase(TestCase): class DiscogsReleaseTestCase(TestCase): + databases = "__all__" + def test_parse(self): t_id_type = IdType.Discogs_Release t_id_value = "25829341" @@ -155,6 +167,8 @@ class DiscogsReleaseTestCase(TestCase): class DiscogsMasterTestCase(TestCase): + databases = "__all__" + def test_parse(self): t_id_type = IdType.Discogs_Master t_id_value = "469004" @@ -182,6 +196,8 @@ class DiscogsMasterTestCase(TestCase): class AppleMusicTestCase(TestCase): + databases = "__all__" + def test_parse(self): t_id_type = IdType.AppleMusic t_id_value = "1284391545" @@ -201,8 +217,10 @@ class AppleMusicTestCase(TestCase): self.assertEqual(site.ready, False) site.get_resource_ready() self.assertEqual(site.ready, True) - self.assertEqual(site.resource.metadata["title"], "Kids Only") + self.assertEqual( + site.resource.metadata["localized_title"][0]["text"], "Kids Only" + ) self.assertEqual(site.resource.metadata["artist"], ["Leah Dou"]) self.assertIsInstance(site.resource.item, Album) - self.assertEqual(site.resource.item.genre, ["Pop"]) - self.assertEqual(site.resource.item.duration, 2371628) + self.assertEqual(site.resource.item.genre, ["Pop", "Music"]) + self.assertEqual(site.resource.item.duration, 2368000) diff --git a/catalog/sites/apple_music.py b/catalog/sites/apple_music.py index 19b89d98..194944d8 100644 --- a/catalog/sites/apple_music.py +++ b/catalog/sites/apple_music.py @@ -9,8 +9,9 @@ Scraping the website directly. """ import json +from datetime import timedelta -import dateparser +from django.utils.dateparse import parse_duration from loguru import logger from catalog.common import * @@ -18,7 +19,6 @@ from catalog.models import * from common.models.lang import ( SITE_DEFAULT_LANGUAGE, SITE_PREFERRED_LANGUAGES, - detect_language, ) from common.models.misc import uniq @@ -39,7 +39,6 @@ class AppleMusic(AbstractSite): headers = { "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "Accept-Language": BasicDownloader.get_accept_language(), "Accept-Encoding": "gzip, deflate", "Connection": "keep-alive", "DNT": "1", @@ -70,80 +69,63 @@ class AppleMusic(AbstractSite): return locales def scrape(self): - matched_content = None + matched_schema_data = None localized_title = [] localized_desc = [] for lang, locales in self.get_locales().items(): for loc in locales: # waterfall thru all locales url = f"https://music.apple.com/{loc}/album/{self.id_value}" try: + tl = f"{lang}-{loc}" if lang == "zh" else lang + headers = { + "Accept-Language": tl, + } + headers.update(self.headers) content = ( BasicDownloader(url, headers=self.headers).download().html() ) - logger.info(f"got localized content from {url}") - elem = content.xpath( - "//script[@id='serialized-server-data']/text()" - ) - txt: str = elem[0] # type:ignore - page_data = json.loads(txt)[0] - album_data = page_data["data"]["sections"][0]["items"][0] - title = album_data["title"] - brief = album_data.get("modalPresentationDescriptor", {}).get( - "paragraphText", "" - ) - tl = detect_language(title + " " + brief) - localized_title.append({"lang": tl, "text": title}) - if brief: - localized_desc.append({"lang": tl, "text": brief}) - if lang == SITE_DEFAULT_LANGUAGE or not matched_content: - matched_content = content + logger.debug(f"got localized content from {url}") + txt: str = content.xpath( + "//script[@id='schema:music-album']/text()" + )[0] # type:ignore + schema_data = json.loads(txt) + title = schema_data["name"] + if title: + localized_title.append({"lang": tl, "text": title}) + try: + txt: str = content.xpath( + "//script[@id='serialized-server-data']/text()" + )[0] # type:ignore + server_data = json.loads(txt) + brief = server_data[0]["data"]["sections"][0]["items"][0][ + "modalPresentationDescriptor" + ]["paragraphText"] + if brief: + localized_desc.append({"lang": tl, "text": brief}) + except Exception: + server_data = brief = None + if lang == SITE_DEFAULT_LANGUAGE or not matched_schema_data: + matched_schema_data = schema_data break except Exception: pass - if matched_content is None: + if matched_schema_data is None: # no schema data found raise ParseError(self, f"localized content for {self.url}") - elem = matched_content.xpath("//script[@id='serialized-server-data']/text()") - txt: str = elem[0] # type:ignore - page_data = json.loads(txt)[0] - album_data = page_data["data"]["sections"][0]["items"][0] - title = album_data["title"] - brief = album_data.get("modalPresentationDescriptor") - brief = brief.get("paragraphText") if brief else None - artist_list = album_data["subtitleLinks"] - artist = [item["title"] for item in artist_list] - - track_data = page_data["data"]["seoData"] - date_elem = track_data.get("musicReleaseDate") - release_datetime = dateparser.parse(date_elem.strip()) if date_elem else None - release_date = ( - release_datetime.strftime("%Y-%m-%d") if release_datetime else None + artist = [a["name"] for a in matched_schema_data.get("byArtist", [])] + release_date = matched_schema_data.get("datePublished", None) + genre = matched_schema_data.get("genre", []) + image_url = matched_schema_data.get("image", None) + track_list = [t["name"] for t in matched_schema_data.get("tracks", [])] + duration = round( + sum( + (parse_duration(t["duration"]) or timedelta()).total_seconds() * 1000 + for t in matched_schema_data.get("tracks", []) + ) ) - - track_list = [ - f"{i}. {track['attributes']['name']}" - for i, track in enumerate(track_data["ogSongs"], 1) - ] - duration_list = [ - track["attributes"].get("durationInMillis", 0) - for track in track_data["ogSongs"] - ] - duration = int(sum(duration_list)) - genre = track_data["schemaContent"].get("genre") - if genre: - genre = [ - genre[0] - ] # apple treat "Music" as a genre. Thus, only the first genre is obtained. - - images = matched_content.xpath("//source[@type='image/jpeg']/@srcset") - image_elem: str = images[0] if images else "" # type:ignore - image_url = image_elem.split(" ")[0] if image_elem else None - pd = ResourceContent( metadata={ "localized_title": uniq(localized_title), "localized_description": uniq(localized_desc), - "title": title, - "brief": brief, "artist": artist, "genre": genre, "release_date": release_date, diff --git a/catalog/tv/models.py b/catalog/tv/models.py index c4aec7d9..a9422f9d 100644 --- a/catalog/tv/models.py +++ b/catalog/tv/models.py @@ -44,6 +44,7 @@ from catalog.common import ( ) from catalog.common.models import LANGUAGE_CHOICES_JSONFORM, LanguageListField from common.models.lang import RE_LOCALIZED_SEASON_NUMBERS, localize_number +from common.models.misc import uniq class TVShowInSchema(ItemInSchema): @@ -414,30 +415,35 @@ class TVSeason(Item): - "Show Title Season X" with some localization """ s = super().display_title - if self.parent_item and ( - RE_LOCALIZED_SEASON_NUMBERS.sub("", s) == "" - or s == self.parent_item.display_title - ): - if self.parent_item.get_season_count() == 1: - return self.parent_item.display_title - elif self.season_number: - return _("{show_title} Season {season_number}").format( - show_title=self.parent_item.display_title, - season_number=localize_number(self.season_number), - ) - else: - return f"{self.parent_item.display_title} {s}" + if self.parent_item: + if ( + RE_LOCALIZED_SEASON_NUMBERS.sub("", s) == "" + or s == self.parent_item.display_title + ): + if self.parent_item.get_season_count() == 1: + return self.parent_item.display_title + elif self.season_number: + return _("{show_title} Season {season_number}").format( + show_title=self.parent_item.display_title, + season_number=localize_number(self.season_number), + ) + else: + return f"{self.parent_item.display_title} {s}" + elif self.parent_item.display_title not in s: + return f"{self.parent_item.display_title} ({s})" return s @cached_property def additional_title(self) -> list[str]: title = self.display_title - return [ - t["text"] - for t in self.localized_title - if t["text"] != title - and RE_LOCALIZED_SEASON_NUMBERS.sub("", t["text"]) != "" - ] + return uniq( + [ + t["text"] + for t in self.localized_title + if t["text"] != title + and RE_LOCALIZED_SEASON_NUMBERS.sub("", t["text"]) != "" + ] + ) def to_indexable_titles(self) -> list[str]: titles = [t["text"] for t in self.localized_title if t["text"]] diff --git a/common/views.py b/common/views.py index e21164e7..c9b827d0 100644 --- a/common/views.py +++ b/common/views.py @@ -83,7 +83,7 @@ def nodeinfo2(request): def _error_response(request, status: int, exception=None, default_message=""): message = str(exception) if exception else default_message - if request.headers.get("HTTP_ACCEPT").endswith("json"): + if request.headers.get("HTTP_ACCEPT", "").endswith("json"): return JsonResponse({"error": message}, status=status) if ( request.headers.get("HTTP_HX_REQUEST") is not None diff --git a/docs/api.md b/docs/api.md deleted file mode 100644 index 06d65e2f..00000000 --- a/docs/api.md +++ /dev/null @@ -1,81 +0,0 @@ -# API - -## Endpoints - -NeoDB has a set of API endpoints mapping to its functions like marking a book or listing collections, they can be found in swagger based API documentation at `/developer/` of your running instance, [a version of it](https://neodb.social/developer/) is available on our flagship instance. - -NeoDB also supports a subset of Mastodon API, details can be found in [Mastodon API documentation](https://docs.joinmastodon.org/api/). - -Both set of APIs can be accessed by the same access token. - -## How to authorize - -### Create an application - -you must have at least one URL included in the Redirect URIs field, e.g. `https://example.org/callback`, or use `urn:ietf:wg:oauth:2.0:oob` if you don't have a callback URL. - -``` -curl https://neodb.social/api/v1/apps \ - -d client_name=MyApp \ - -d redirect_uris=https://example.org/callback \ - -d website=https://my.site -``` - -and save of the `client_id` and `client_secret` returned in the response: - -``` -{ - "client_id": "CLIENT_ID", - "client_secret": "CLIENT_SECRET", - "name": "MyApp", - "redirect_uri": "https://example.org/callback", - "vapid_key": "PUSH_KEY", - "website": "https://my.site" -} -``` - - -### Guide your user to open this URL - -``` -https://neodb.social/oauth/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=https://example.org/callback&scope=read+write -``` - -### Once authorizated by user, it will redirect to `https://example.org/callback` with a `code` parameter: - -``` -https://example.org/callback?code=AUTH_CODE -``` - -### Obtain access token with the following POST request: - -``` -curl https://neodb.social/oauth/token \ - -d "client_id=CLIENT_ID" \ - -d "client_secret=CLIENT_SECRET" \ - -d "code=AUTH_CODE" \ - -d "redirect_uri=https://example.org/callback" \ - -d "grant_type=authorization_code" -``` - -and access token will be returned in the response: - -``` -{ - "access_token": "ACCESS_TOKEN", - "token_type": "Bearer", - "scope": "read write" -} -``` - -### Use the access token to access protected endpoints like `/api/me` - -``` -curl -H "Authorization: Bearer ACCESS_TOKEN" -X GET https://neodb.social/api/me -``` - -and response will be returned accordingly: - -``` -{"url": "https://neodb.social/users/xxx/", "external_acct": "xxx@yyy.zzz", "display_name": "XYZ", "avatar": "https://yyy.zzz/xxx.gif"} -``` diff --git a/docs/apps.md b/docs/apps.md deleted file mode 100644 index e5175a28..00000000 --- a/docs/apps.md +++ /dev/null @@ -1,19 +0,0 @@ -# Apps - -NeoDB web version will provide the most features and experience, while some third-party apps are also available below. - -## Apps for NeoDB - -A few apps for NeoDB are being actively developed: - - - [Piecelet](https://piecelet.app) by `@piecelet@mastodon.social` - [App Store](https://apps.apple.com/app/piecelet-for-neodb/id6739444863) / [Source Code](https://github.com/lcandy2/neodb-app) - - [Chihu](https://chihu.app) by `@chihu@mastodon.social` - [Test Flight](https://testflight.apple.com/join/WmbnP9Vx) - -These apps are not affiliated with NeoDB, but they are being developed with the support of this community. If you are also developing an app for NeoDB, and wish to share that with the community, please [edit this file](https://github.com/neodb-social/neodb/edit/main/docs/apps.md) and submit a pull request. - - -## Mastodon apps - -[Mastodon compatible mobile and native apps](https://joinmastodon.org/apps) can be used to log in and utilize the micro-blogging features in NeoDB server. - -In addition to micro-blogging, Mastodon compatible can also be used to take note on book you are currently reading. Just head to bookmark section in your app, your currently reading books are listed there as bookmarked posts, replying any of them will make a note for that book. diff --git a/docs/assets/logo.svg b/docs/assets/logo.svg deleted file mode 100644 index 8a1418e3..00000000 --- a/docs/assets/logo.svg +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/configuration.md b/docs/configuration.md deleted file mode 100644 index b52a85af..00000000 --- a/docs/configuration.md +++ /dev/null @@ -1,210 +0,0 @@ -# Configuration - - -## Important settings you may want to change first - -absolutely set these in `.env` before start the instance for the first time: - - - `NEODB_SECRET_KEY` - 50 characters of random string, no white space - - `NEODB_SITE_NAME` - the name of your site - - `NEODB_SITE_DOMAIN` - the domain name of your site - -**`NEODB_SECRET_KEY` and `NEODB_SITE_DOMAIN` must not be changed later.** - -if you are doing debug or development: - - - `NEODB_DEBUG` - True will turn on debug for both neodb and takahe, turn off relay, and reveal self as debug mode in nodeinfo (so peers won't try to run fedi search on this node) - - `NEODB_IMAGE` - the docker image to use, `neodb/neodb:edge` for the main branch - -## Settings for customization - - - `NEODB_SITE_LOGO` - - `NEODB_SITE_ICON` - - `NEODB_USER_ICON` - - `NEODB_SITE_COLOR` - one of [these color schemes](https://picocss.com/docs/colors) - - `NEODB_SITE_INTRO` - - `NEODB_SITE_HEAD` - - `NEODB_SITE_DESCRIPTION` - - `NEODB_PREFERRED_LANGUAGES` - preferred languages when importing titles from 3rd party sites like TMDB and Steam, comma-separated list of ISO-639-1 two-letter codes, `en,zh` by default. It can includes languages with no UI translations yet, e.g. if set to `ja,en,zh`, NeoDB scraper will fetch catalog metadata in three languages if they are available from third party sites, Japanese users (= whose browser language set to ja-JP) will see English UI with Japanese metadata. - - `NEODB_DISCOVER_FILTER_LANGUAGE` - `False` by default; when set to `True`, `/discover/` will only show items with languages match one of `NEODB_PREFERRED_LANGUAGES`. - - `NEODB_DISCOVER_SHOW_LOCAL_ONLY` - `False` by default; when set to `True`, only show items marked by local users rather than entire network on `/discover/` - - `NEODB_DISCOVER_UPDATE_INTERVAL` - minutes between each update for popular items on `/discover/` - - `NEODB_SITE_LINKS` - a list of title and links to show in the footer, comma separated, e.g. `Feedback=https://discord.gg/8KweCuApaK,ToS=/pages/rules/` - - `NEODB_INVITE_ONLY` - `False` by default, set to `True` to require invite code(generated by `neodb-manage invite --create`) to register - - `NEODB_ENABLE_LOCAL_ONLY` - `False` by default, set to `True` to allow user to post marks as "local public" - - `NEODB_LOGIN_MASTODON_WHITELIST` - a list of Mastodon instances to allow login from, comma separated - - `NEODB_EMAIL_FROM` - the email address to send email from - - `NEODB_EMAIL_URL` - email sender configuration, e.g. - - `smtp://:@:` - - `smtp+tls://:@:` - - `smtp+ssl://:@:` - - `anymail://?`, to send email via email service providers, see [anymail doc](https://anymail.dev/) - -## Settings for administration - - `DISCORD_WEBHOOKS` - Discord channel to send notification about user submitted suggestion and changes, e.g. `suggest=https://discord.com/api/webhooks/123/abc,audit=https://discord.com/api/webhooks/123/def`. Both suggest and audit channels must be in forum mode. - - `NEODB_SENTRY_DSN` , `TAKAHE_SENTRY_DSN` - [Sentry](https://sentry.io/) DSN to log errors. - -## Settings for Federation - - - `NEODB_SEARCH_PEERS` is empty by default, which means NeoDB will search all known peers running production version of NeoDB when user look for items. This can be set to a comma-separated list of host names, so that NeoDB will only search those servers; or search no other peers if set to just `-`. - - - `NEODB_DISABLE_DEFAULT_RELAY` is set to `False` by default, the server will send and receive public posts from `relay.neodb.net`. - - `relay.neodb.net` is [open sourced](https://github.com/neodb-social/neodb-relay) and operated by NeoDB developers, it works like most ActivityPub relays except it only relays between NeoDB instances, it helps public information like catalogs and trends flow between NeoDB instances. You may set it to `True` if you don't want to relay public posts with other NeoDB instances. - - -## Settings for external item sources - -- `SPOTIFY_API_KEY` - base64('CLIENT_ID:SECRET'), see [spotify doc](https://developer.spotify.com/documentation/web-api/tutorials/client-credentials-flow) -- `TMDB_API_V3_KEY` - API v3 key from [TMDB](https://developer.themoviedb.org/) -- `GOOGLE_API_KEY` - API key for [Google Books](https://developers.google.com/books/docs/v1/using) -- `DISCOGS_API_KEY` - personal access token from [Discogs](https://www.discogs.com/settings/developers) -- `IGDB_API_CLIENT_ID`, `IGDB_API_CLIENT_SECRET` - IGDB [keys](https://api-docs.igdb.com/) -- `NEODB_SEARCH_SITES` is empty by default, which means NeoDB will search all available sources. This can be set to a comma-separated list of site names (e.g. `goodreads,googlebooks,spotify,tmdb,igdb,bandcamp,apple_podcast`), so that NeoDB will only search those sites; or not search any of them if set to just `-`. - - -## Other maintenance tasks - -Add alias to your shell for easier access - -``` -alias neodb-manage='docker-compose --profile production run --rm shell neodb-manage' -``` - -Toggle user's active, staff and super user status - -``` -neodb-manage user --active -neodb-manage user --staff -neodb-manage user --super -``` - -create a super user; delete a user / remote identity (`takahe-stator` and `neodb-worker` containers must be running to complete the deletion) -``` -neodb-manage createsuperuser -neodb-manage user --delete username -neodb-manage user --delete username@remote.instance -``` - -Create an invite link - -``` -neodb-manage invite --create -``` - -Manage user tasks and cron jobs - -``` -neodb-manage task --list -neodb-manage cron --list -``` - -Manage search index -``` -neo-manage index --reindex -``` - -Crawl links -``` -neodb-manage cat [--save] # parse / save a supported link -neodb-manage crawl # crawl all recognizable links from a page -``` - - -## Run PostgresQL/Redis/Typesense without Docker - -It's currently possible but quite cumbersome to run without Docker, hence not recommended. However it's possible to only use docker to run neodb server but reuse existing PostgresQL/Redis/Typesense servers with `compose.override.yml`, an example for reference: - -``` -services: - redis: - profiles: ['disabled'] - typesense: - profiles: ['disabled'] - neodb-db: - profiles: ['disabled'] - takahe-db: - profiles: ['disabled'] - migration: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - neodb-web: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - healthcheck: !reset {} - neodb-web-api: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - healthcheck: !reset {} - neodb-worker: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - neodb-worker-extra: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - takahe-web: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - takahe-stator: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - shell: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - root: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - dev-neodb-web: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - dev-neodb-worker: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - dev-takahe-web: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - dev-takahe-stator: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - dev-shell: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] - dev-root: - extra_hosts: - - "host.docker.internal:host-gateway" - depends_on: !reset [] -``` -(`extra_hosts` is only needed if PostgresQL/Redis/Typesense is on your host server) - - -## Multiple instances on one server - -It's possible to run multiple clusters in one host server with docker compose, as long as `NEODB_SITE_DOMAIN`, `NEODB_PORT` and `NEODB_DATA` are different. - - -## Scaling up - -For high-traffic instance, spin up these configurations to a higher number, as long as the host server can handle them: - - - `NEODB_WEB_WORKER_NUM` - - `NEODB_API_WORKER_NUM` - - `NEODB_RQ_WORKER_NUM` - - `TAKAHE_WEB_WORKER_NUM` - - `TAKAHE_STATOR_CONCURRENCY` - - `TAKAHE_STATOR_CONCURRENCY_PER_MODEL` - -Further scaling up with multiple nodes (e.g. via Kubernetes) is beyond the scope of this document, but consider run db/redis/typesense separately, and then duplicate web/worker/stator containers as long as connections and mounts are properly configured; `migration` only runs once when start or upgrade, it should be kept that way. diff --git a/docs/development.md b/docs/development.md deleted file mode 100644 index 95d3f973..00000000 --- a/docs/development.md +++ /dev/null @@ -1,187 +0,0 @@ -Development -=========== - -Overview --------- -NeoDB is a Django project, and it runs side by side with a [modified version](https://github.com/neodb-social/neodb-takahe) of [Takahē](https://github.com/jointakahe/takahe) (a separate Django project, code in `neodb_takahe` folder of this repo as submodule). They communicate with each other mainly thru database and task queue, [the diagram](troubleshooting.md#containers) demonstrates a typical architecture. Currently the two are loosely coupled, so you may take either one offline without immediate impact on the other, which makes it very easy to conduct maintenance and troubleshooting separately. In the future, they may get combined but it's not decided and will not be decided very soon. - - -Prerequisite ------------- -- Python 3.12.x -- Docker Compose v2 or newer - - -Prepare the code ----------------- -When checking out NeoDB source code, make sure submodules are also checked out: -``` -git clone https://github.com/neodb-social/neodb.git -cd neodb -git submodule update --init -``` - -Install [rye](http://rye.astral.sh) package manager, packages and pre-commit hooks: -``` -curl -sSf https://rye.astral.sh/get | bash -rye sync -. .venv/bin/activate -pre-commit install -``` - -To develop Takahe, install requirements(-dev) and pre-commit hooks for `neodb-takahe` project as well, preferably using a different virtual environment. - -Note: the virtual environments and packages installed in this step are mostly for linting, the actual virtual environments and packages are from NeoDB docker image, and they can be configured differently, more on this later in this document. - - -Start local instance for development ------------------------------------- -Follow [install guide](install.md) to create `.env` in the root folder of NeoDB code, including at least these configuration: -``` -NEODB_SITE_NAME="My Test" -NEODB_SITE_DOMAIN=mydomain.dev -NEODB_SECRET_KEY=_random_string__50_characters_of_length__no_whitespaces_ -NEODB_IMAGE=neodb/neodb:edge -NEODB_DEBUG=True -``` - -Download docker images and start pgsql/redis/typesense before initializing database schema: -``` -docker compose --profile dev pull -docker compose up -d -``` - -Initialize database schema: -``` -docker compose --profile dev run --rm dev-shell takahe-manage collectstatic --noinput -docker compose --profile dev run --rm dev-shell neodb-init -``` - -Start the cluster: -``` -docker compose --profile dev up -d -``` - -Watch the logs: -``` -docker compose --profile dev logs -f -``` - -Now the local development instance is ready to serve at `http://localhost:8000`, but to develop or test anything related with ActivityPub, reverse proxying it from externally reachable https://`NEODB_SITE_DOMAIN`/ is required; https is optional theoretically but in reality required for various compatibility reasons. - -Note: `dev` profile is for development only, and quite different from `production`, so always use `--profile dev` instead of `--profile production`, more on those differences later in this document. - - -Common development tasks ------------------------- -Shutdown the cluster: -``` -docker compose --profile dev down -``` - -Restart background tasks (unlike web servers, background tasks don't auto reload after code change): -``` -docker-compose --profile dev restart dev-neodb-worker dev-takahe-stator -``` - -When updating code, always update submodules: -``` -git pull -git submodule update --init -``` -With newer git 2.15+, you main use `git pull --recurse-submodules` or `git config --global submodule.recurse true` to make it automatic. - - -To save some typing, consider adding some aliases to `~/.profile`: -``` -alias neodb-logs='docker compose --profile dev logs' -alias neodb-shell='docker compose --profile dev run --rm dev-shell' -alias neodb-manage='docker compose --profile dev run --rm dev-shell neodb-manage' -``` - -Always use `neodb-init`, not `python3 manage.py migrate`, to update db schema after updating code: -``` -neodb-shell neodb-init -``` - -Run unit test: -``` -neodb-manage test -``` - -Update translations: -``` -django-admin makemessages --no-wrap --no-obsolete -i .venv -i neodb-takahe --keep-pot -l zh_Hans -l zh_Hant - -# edit .po files, run the following to make sure edits are correct - -django-admin makemessages --no-wrap --no-obsolete -i .venv -i neodb-takahe --keep-pot -l zh_Hans -l zh_Hant -django-admin compilemessages -i .venv -i neodb-takahe -``` - -Preview documentation: -``` -python -m mkdocs serve -``` - -Development in Docker Compose ------------------------------ -The `dev` profile is different from `production`: - -- code in `NEODB_SRC` (default: .) and `TAKAHE_SRC` (default: ./neodb-takahe) will be mounted and used in the container instead of code in the image -- `runserver` with autoreload will be used instead of `gunicorn` for both neodb and takahe web server -- /static/ and /s/ url are not map to pre-generated/collected static file path, `NEODB_DEBUG=True` is required locate static files from source code -- one `rqworker` container will be started, instead of two -- use `dev-shell` and `dev-root` to invoke shells, instead of `shell` and `root` -- there's no automatic `migration` container, but it can be triggered manually via `docker compose run dev-shell neodb-init` - -Note: - -- Python virtual environments inside docker image, which are `/neodb-venv` and `/takahe-venv`, will be used by default. They can be changed to different locations with `TAKAHE_VENV` and `NEODB_VENV` if needed, usually in a case of development code using a package not in docker venv. -- Some packages inside python virtual environments are platform dependent, so mount venv built by macOS host into the Linux container will likely not work. -- Python servers are launched as `app` user, who has no write access to anywhere except /tmp and media path, that's by design. -- Database/redis/typesense used in the container cluster are not accessible from host directly, which is by design. Querying them can be done by one of the following: - - `neodb-manage dbshell` - - `neodb-shell redis-cli -h redis` - - or create `compose.override.yml` to uncomment `ports` section. -- To expose the neodb and takahe web server directly, in the folder for configuration, create `compose.override.yml` with the following content: - -``` -services: - dev-neodb-web: - ports: - - "8001:8000" - - dev-takahe-web: - ports: - - "8002:8000" -``` - - -Development with Github Codespace ---------------------------------- -At the time of writing, docker compose will work in Github Codespace by adding this in `.env`: - -``` -NEODB_SITE_DOMAIN=${CODESPACE_NAME}-8000.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN} -``` - - -Applications ------------- -Main Django apps for NeoDB: - - - `users` manages user in typical Django fashion - - `mastodon` this leverages [Mastodon API](https://docs.joinmastodon.org/client/intro/), [Threads API](https://developers.facebook.com/docs/threads/) and [ATProto}(https://atproto.com) for user login and data sync - - `catalog` manages different types of items user may collect, and scrapers to fetch from external resources, see [catalog.md](internals/catalog.md) for more details - - `journal` manages user created content(review/ratings) and lists(collection/shelf/tag/note), see [journal.md](internals/journal.md) for more details - - `social` present timeline and notification for local users - - `takahe` communicate with Takahe (a separate Django server, run side by side with this server, code in `neodb_takahe` as submodule), see [federation.md](internals/federation.md) for customization of ActivityPub protocol - - `legacy` this is only used by instances upgraded from 0.4.x and earlier, to provide a link mapping from old urls to new ones. If your journey starts with 0.5 and later, feel free to ignore it. - - -Miscellaneous notes -------------------- -If models in `takahe/models.py` are changed, instead of adding incremental migrations, just regenerate `takahe/migrations/0001_initial.py` instead, because these migrations will never be applied except for constructing a test database. - -A `libsass` wheel is stored in the repo to speed up docker image building process in Github Action. diff --git a/docs/features.md b/docs/features.md deleted file mode 100644 index d054e7cc..00000000 --- a/docs/features.md +++ /dev/null @@ -1,69 +0,0 @@ -# Features - -NeoDB has [various features](features.md), and you may image it as a mix of Mastodon, Goodreads, Letterboxd, RateYourMusic, Podchaser, and more. - -## Public catalog - - - a shared catalog of books/movies/tv shows/music album/games/podcasts/performances - - search or create catalog items in each category - - one click create item with links to 3rd party sites: - - Goodreads - - IMDB - - The Movie Database - - Douban - - Google Books - - Discogs - - Spotify - - Apple Music - - Bandcamp - - Steam - - IGDB - - Bangumi - - Board Game Geek - - any RSS link to a podcast - - ...[full list](sites.md) - - -## Personal collections - - - mark an item as wishlist/in progress/complete/dropped - - rate and write reviews for an item - - write notes for an item with progress (e.g. reading notes at page 42) - - create tags for an item, either privately or publicly - - create and share list of items - - tracking progress of a list (e.g. personal reading challenges) - - Import and export full user data archive - - import list or archives from some 3rd party sites: - - Goodreads reading list - - Letterboxd watch list - - Douban archive (via [Doufen](https://doufen.org/)) - - -## Social - - - view home feed with friends' activities - - every activity can be set as viewable to self/follower-only/public - - eligible items, e.g. podcasts and albums, are playable in feed - - login with other Fediverse identity and import social graph - - supported servers: Mastodon/Pleroma/Firefish/GoToSocial/Pixelfed/friendica/Takahē - - login with Bluesky / ATProto identity and import social graph - - login with threads.net (requires app verification by Meta) - - share collections and reviews to Fediverse/Bluesky/Threads - - ActivityPub support - - NeoDB users can follow and interact with users on other ActivityPub services like Mastodon and Pleroma - - NeoDB instances communicate with each other via an extended version of ActivityPub - - NeoDB instances may share public rating and reviews with a default relay - - implementation is based on [Takahē](https://jointakahe.org/) server - - -## API - - Mastodon compatible API - - most mastodon compatible apps are compatible with NeoDB - - NeoDB API to manage reviews and collections - -## Languages - - - English - - Simplified Chinese - - Traditional Chinese - - more to come and your contributions are welcomed! diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 7b504e75..00000000 --- a/docs/index.md +++ /dev/null @@ -1,47 +0,0 @@ -NeoDB is an open-source software and global community platform [since 2021](origin.md). It helps users to manage and explore collections, reviews, and ratings for various cultural products, including books, movies, music, podcasts, games, and performances. Additionally, users can share their collections, publish microblogs, and engage with others in the Fediverse. NeoDB integrates the functionalities of platforms like Goodreads, Letterboxd, RateYourMusic, and Podchaser, among others. It also supports self-hosting and interconnection through containerized deployment and the ActivityPub protocol. - -This project is licensed under AGPLv3. - - -## How to use - -Please [find a server](servers.md) to register with your email, Mastodon or Bluesky ID. - -Besides the web version of your chosen server, you may also use [various apps](apps.md) to login and manage your collections. - - -## Host your own instance - -You can [install and run your own instance of NeoDB](install.md). If you decide to share your server with the public, please inform us so that we can add it to the list above. - -All instances interact with each other in the Fediverse via ActivityPub, allowing you to follow users from other NeoDB instances or instances running other ActivityPub software, such as Mastodon. - - -## API, Development and Translation - - - NeoDB offers [APIs to manage user collections](api.md), and [Mastodon client compatible API](https://docs.joinmastodon.org/client/) to manage user posts. - - For those interested in developing for NeoDB, please refer to the [development](development.md) section for basic instructions to get started. - - To help translate NeoDB to more languages, please join [our project on Weblate](https://hosted.weblate.org/projects/neodb/) - - -## Copyleft - - - NeoDB software code is licensed under AGPL, please check it if you plan to provide a service with modified code. - - If you publish a work (e.g. application, website or service) utilizing NeoDB software or API, you may use "NeoDB" and its visual identity in your work, but please refrain from any usage that may imply the affiliation with NeoDB software and team. - - If you publish such work to serve others, we do appreciate you clearly mention the usage of NeoDB in your work, provide descriptions and links to NeoDB software (neodb.net) and service providers (e.g. neodb.social), and guide your users to support them directly. - - -## Donation - -If you appreciate this project, please help spread the words, and consider sponsoring the service providers. Your support is essential to keep these services free, open-sourced and stay committed to their mission. You may donate to the flagship instance, NeoDB.social, through the link below; or check the instance you use for their details about donations. - - [![Kofi](https://img.shields.io/badge/Ko--Fi-Donate-orange?label=Support%20this%20project%20on%20Ko-fi&style=for-the-badge&color=ff5f5f&logo=ko-fi)](https://ko-fi.com/neodb) - - -## Feedback - -Follow us on the Fediverse or join our Discord community to share your ideas, questions, or creations. - -[![Mastodon](https://img.shields.io/mastodon/follow/106935434138389355?domain=https%3A%2F%2Fmastodon.online&style=for-the-badge&logo=mastodon&logoColor=fff&label=%40neodb%40mastodon.online&color=6D75D2)](https://mastodon.online/@neodb) -[![Mastodon](https://img.shields.io/mastodon/follow/106919732872456302?style=for-the-badge&logo=mastodon&logoColor=fff&label=%40neodb%40mastodon.social&color=6D75D2)](https://mastodon.social/@neodb) -[![Discord](https://img.shields.io/discord/1041738638364528710?label=Discord%20Community&logo=discord&logoColor=fff&color=6D75D2&style=for-the-badge&cacheSeconds=21600)](https://discord.gg/QBHkrV8bxK) diff --git a/docs/install.md b/docs/install.md deleted file mode 100644 index 3ee14c42..00000000 --- a/docs/install.md +++ /dev/null @@ -1,90 +0,0 @@ -Install -======= - -For small and medium NeoDB instances, it's recommended to deploy as a container cluster with Docker Compose. To run a large instance, please see [scaling up](configuration.md#scaling-up) for some tips. - -## Install docker compose - -Follow [official instructions](https://docs.docker.com/compose/install/) to install Docker Compose if not yet. - -Please verify its version is 2.x or higher before next step: - -``` -docker compose version -``` - -The rest of this doc assumes you can run docker commands without `sudo`, to verify that: - -``` -docker run --rm hello-world -``` - -Follow [official instructions](https://docs.docker.com/engine/install/linux-postinstall/) if it's not enabled, or use `sudo` to run commands in this doc. - - -## Prepare configuration files - - create a folder for configuration, eg ~/mysite/config - - grab `compose.yml` and `neodb.env.example` from [latest release](https://github.com/neodb-social/neodb/releases) - - rename `neodb.env.example` to `.env` - - -## Set up .env file and web root -Change essential options like `NEODB_SITE_DOMAIN` in `.env` before starting the cluster for the first time. Changing them later may have unintended consequences, please make sure they are correct before exposing the service externally. - -- `NEODB_SITE_NAME` - name of your site -- `NEODB_SITE_DOMAIN` - domain name of your site -- `NEODB_SECRET_KEY` - encryption key of session data -- `NEODB_DATA` is the path to store db/media/cache, it's `../data` by default, but can be any path that's writable -- `NEODB_DEBUG` - set to `False` for production deployment -- `NEODB_PREFERRED_LANGUAGES` - preferred languages when importing titles from 3rd party sites like TMDB and Steam, comma-separated list of ISO-639-1 two-letter codes, 'en,zh' by default. - -Optionally, `robots.txt` and `logo.png` may be placed under `$NEODB_DATA/www-root/`. - -See [neodb.env.example](https://raw.githubusercontent.com/neodb-social/neodb/main/neodb.env.example) and [configuration](configuration.md) for more options - - -## Start container - -in the folder with `compose.yml` and `.env`, execute as the user you just created: -``` -docker compose --profile production pull -docker compose --profile production up -d -``` - -Starting up for the first time might take a few minutes, depending on download speed, use the following commands for status and logs: -``` -docker compose ps -docker compose --profile production logs -f -``` - -In a few seconds, the site should be up at 127.0.0.1:8000 , you may check it with: -``` -curl http://localhost:8000/nodeinfo/2.0/ -``` - -JSON response will be returned if the server is up and running: -``` -{"version": "2.0", "software": {"name": "neodb", "version": "0.8-dev"}, "protocols": ["activitypub", "neodb"], "services": {"outbound": [], "inbound": []}, "usage": {"users": {"total": 1}, "localPosts": 0}, "openRegistrations": true, "metadata": {}} -``` - - -## Make the site available publicly - -Next step is to expose `http://127.0.0.1:8000` to external network as `https://yourdomain.tld` (NeoDB requires `https`). There are many ways to do it, you may use nginx or caddy as a reverse proxy server with an SSL cert configured, or configure a tunnel provider like cloudflared to do the same. Once done, you may check it with: - -``` -curl https://yourdomain.tld/nodeinfo/2.0/ -``` - -You should see the same JSON response as above, and the site is now accessible to the public. - - -## Register an account and make it admin - -Open `https://yourdomain.tld` in your browser and register an account, assuming username `admin`, run the following command to make it super user - -``` -docker compose --profile production run --rm shell neodb-manage user --super admin -``` - -Now your instance should be ready to serve. More tweaks are available, see [configuration](configuration.md) for options. diff --git a/docs/internals/catalog.md b/docs/internals/catalog.md deleted file mode 100644 index 5d25a6c4..00000000 --- a/docs/internals/catalog.md +++ /dev/null @@ -1,114 +0,0 @@ -Catalog -======= - -Data Models ------------ -all types of catalog items inherits from `Item` which stores as multi-table django model. -one `Item` may have multiple `ExternalResource`s, each represents one page on an external site - -```mermaid -classDiagram - class Item { - <> - } - Item <|-- Album - class Album { - +String barcode - +String Douban_ID - +String Spotify_ID - } - Item <|-- Game - class Game { - +String Steam_ID - } - Item <|-- Podcast - class Podcast { - +String feed_url - +String Apple_ID - } - Item <|-- Performance - Item <|-- Work - class Work { - +String Douban_Work_ID - +String Goodreads_Work_ID - } - Item <|-- Edition - Item <|-- Series - - Series *-- Work - Work *-- Edition - - class Series { - +String Goodreads_Series_ID - } - class Work { - +String Douban_ID - +String Goodreads_ID - } - class Edition{ - +String ISBN - +String Douban_ID - +String Goodreads_ID - +String GoogleBooks_ID - } - - Item <|-- Movie - Item <|-- TVShow - Item <|-- TVSeason - Item <|-- TVEpisode - TVShow *-- TVSeason - TVSeason *-- TVEpisode - - class TVShow{ - +String IMDB_ID - +String TMDB_ID - } - class TVSeason{ - +String Douban_ID - +String TMDB_ID - } - class TVEpisode{ - +String IMDB_ID - +String TMDB_ID - } - class Movie{ - +String Douban_ID - +String IMDB_ID - +String TMDB_ID - } - - Item <|-- Collection - - ExternalResource --* Item - class ExternalResource { - +enum site - +url: string - } -``` - -Add a new site --------------- - - - If official API is available for the site, it should be the preferred way to get data. - - add a new value to `IdType` and `SiteName` in `catalog/common/models.py` - - add a new file in `catalog/sites/`, a new class inherits `AbstractSite`, with: - * `SITE_NAME` - * `ID_TYPE` - * `URL_PATTERNS` - * `WIKI_PROPERTY_ID` (not used now) - * `DEFAULT_MODEL` (unless specified in `scrape()` return val) - * a classmethod `id_to_url()` - * a method `scrape()` returns a `ResourceContent` object - * `BasicDownloader` or `ProxiedDownloader` can used to download website content or API data. e.g. `content = BasicDownloader(url).download().html()` - * check out existing files in `catalog/sites/` for more examples - - add an import in `catalog/sites/__init__.py` - - add some tests to `catalog//tests.py` according to site type - + add `DOWNLOADER_SAVEDIR = '/tmp'` to `settings.py` can save all response to /tmp - + run `neodb-manage cat ` for debugging or saving response file to `/tmp`. Detailed code of `cat` is in `catalog/management/commands/cat.py` - + move captured response file to `test_data/`, except large/images files. Or if have to, replace it with a smallest version (e.g. 1x1 pixel / 1s audio) - + add `@use_local_response` decorator to test methods that should pick up these responses (if `BasicDownloader` or `ProxiedDownloader` is used) - - run all the tests and make sure they pass - - Command: `neodb-manage python3 manage.py test [--keepdb]`. - - See [this issue](https://github.com/neodb-social/neodb/issues/5) if `lxml.etree.ParserError` occurs on macOS. - - add a site UI label style to `common/static/scss/_sitelabel.scss` - - update documentation in [sites.md](../sites.md) diff --git a/docs/internals/federation.md b/docs/internals/federation.md deleted file mode 100644 index 496019cb..00000000 --- a/docs/internals/federation.md +++ /dev/null @@ -1,131 +0,0 @@ -# Federation - -## Supported federation protocols and standards - -- [ActivityPub](https://www.w3.org/TR/activitypub/) (Server-to-Server) -- [WebFinger](https://webfinger.net/) -- [Http Signatures](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures) -- [NodeInfo](https://nodeinfo.diaspora.software/) - -## Supported FEPs - -- [FEP-f1d5: NodeInfo in Fediverse Software](https://codeberg.org/fediverse/fep/src/branch/main/fep/f1d5/fep-f1d5.md) - -## NodeInfo - -NeoDB instances can be identified from user agent string (`NeoDB/x.x (+https://example.org)`) and `protocols` in its nodeinfo, e.g. https://neodb.social/nodeinfo/2.0/ : -```json -{ - "version": "2.0", - "software": { - "name": "neodb", - "version": "0.10.4.13", - "repository": "https://github.com/neodb-social/neodb", - "homepage": "https://neodb.net/" - }, - "protocols": ["activitypub", "neodb"], -} -``` - - -## ActivityPub - -NeoDB's ActivityPub implementation is based on [Takahē](https://jointakahe.org), with some change to enable interchange of additional information between NeoDB instances. - -### Activity - -NeoDB add additional fields to `Note` activity: - - - `relatedWith` is a list of NeoDB specific activities which are associated with this `Note`. For each activity, `id` and `href` are both unique links to that activity, `withRegardTo` links to the catalog item, `attributedTo` links to the user, `type` is one of: - - `Status`, its `status` can be one of: `complete`, `progress`, `wishlist` and `dropped` - - `Rating`, its `value` is rating grade (int, 1-10), `worst` is always 1, `best` is always 10 - - `Comment`, its `content` is comment text - - `Review`, its `name` is review title, `content` is its body, `mediaType` is always `text/markdown` for now - - `Note`, its `content` is note text - - `tag` is used to store list of NeoDB catalog items, which are related with this activity. `type` of NeoDB catalog item can be one of `Edition`, `Movie`, `TVShow`, `TVSeason`, `TVEpisode`, `Album`, `Game`, `Podcast`, `PodcastEpisode`, `Performance`, `PerformanceProduction`; href will be the link to that item. - -Example: -```json -{ - "@context": ["https://www.w3.org/ns/activitystreams", { - "blurhash": "toot:blurhash", - "Emoji": "toot:Emoji", - "focalPoint": { - "@container": "@list", - "@id": "toot:focalPoint" - }, - "Hashtag": "as:Hashtag", - "manuallyApprovesFollowers": "as:manuallyApprovesFollowers", - "sensitive": "as:sensitive", - "toot": "http://joinmastodon.org/ns#", - "votersCount": "toot:votersCount", - "featured": { - "@id": "toot:featured", - "@type": "@id" - } - }, "https://w3id.org/security/v1"], - "id": "https://neodb.social/@april_long_face@neodb.social/posts/380919151408919488/", - "type": "Note", - "relatedWith": [{ - "id": "https://neodb.social/p/5oyF0qRx96mKKmVpFzHtMM", - "type": "Status", - "status": "complete", - "withRegardTo": "https://neodb.social/movie/7hfF7d0aFMaqHpFjUpq4zR", - "attributedTo": "https://neodb.social/@april_long_face@neodb.social/", - "href": "https://neodb.social/p/5oyF0qRx96mKKmVpFzHtMM", - "published": "2024-11-17T10:16:42.745240+00:00", - "updated": "2024-11-17T10:16:42.750917+00:00" - }, { - "id": "https://neodb.social/p/47cJnbQTkbSSN2izLwQMjo", - "type": "Comment", - "withRegardTo": "https://neodb.social/movie/7hfF7d0aFMaqHpFjUpq4zR", - "attributedTo": "https://neodb.social/@april_long_face@neodb.social/", - "content": "Broadway cin\u00e9math\u00e8que, at least I laughed hard.", - "href": "https://neodb.social/p/47cJnbQTkbSSN2izLwQMjo", - "published": "2024-11-17T10:16:42.745240+00:00", - "updated": "2024-11-17T10:16:42.777276+00:00" - }, { - "id": "https://neodb.social/p/3AyYu974qo6OU09AAsPweQ", - "type": "Rating", - "best": 10, - "value": 7, - "withRegardTo": "https://neodb.social/movie/7hfF7d0aFMaqHpFjUpq4zR", - "worst": 1, - "attributedTo": "https://neodb.social/@april_long_face@neodb.social/", - "href": "https://neodb.social/p/3AyYu974qo6OU09AAsPweQ", - "published": "2024-11-17T10:16:42.784220+00:00", - "updated": "2024-11-17T10:16:42.786458+00:00" - }], - "attributedTo": "https://neodb.social/@april_long_face@neodb.social/", - "content": "

\u770b\u8fc7 \u963f\u8bfa\u62c9 \ud83c\udf15\ud83c\udf15\ud83c\udf15\ud83c\udf17\ud83c\udf11
Broadway cin\u00e9math\u00e8que, at least I laughed hard.

#\u6211\u770b\u6211\u542c\u6211\u8bfb

", - "published": "2024-11-17T10:16:42.745Z", - "sensitive": false, - "tag": [{ - "type": "Hashtag", - "href": "https://neodb.social/tags/\u6211\u770b\u6211\u542c\u6211\u8bfb/", - "name": "#\u6211\u770b\u6211\u542c\u6211\u8bfb" - }, { - "type": "Movie", - "href": "https://neodb.social/movie/7hfF7d0aFMaqHpFjUpq4zR", - "image": "https://neodb.social/m/item/doubanmovie/2024/09/13/a30bf2f3-4f79-43ef-b22f-58ebc3fd8aae.jpg", - "name": "Anora" - }], - "to": ["https://www.w3.org/ns/activitystreams#Public"], - "updated": "2024-11-17T10:16:42.750Z", - "url": "https://neodb.social/@april_long_face/posts/380919151408919488/" -} -``` - -This is not ideal but a practical manner to pass along additional information between NeoDB instances and other ActivityPub servers. We have some ideas for improvements, but are open to more suggestions. - - -### Relay - -NeoDB instances may share public rating and reviews with a default relay, which is currently `https://relay.neodb.net`. This relay is used to propagate public activities and catalog information between NeoDB instances. - -Owner of each instance may choose to turn this off in their admin settings. - - -## ATProto - -NeoDB is not a PDS itself currently, but can interact with PDS to import user's social graph, and send status updates. So technically NeoDB does not do full federation in ATProto, but NeoDB will handle some side effect from federation, e.g. when user logging in via ATProto handle, NeoDB will resolve user's DID and store it, and will attempt further operation with the DID, and update user's handle if that's changed, and use the corresponding PDS for that handle; user may still have to login NeoDB again with their Bluesky app password, since the change of PDS may invalidates previous app password. diff --git a/docs/internals/journal.md b/docs/internals/journal.md deleted file mode 100644 index d2785ac3..00000000 --- a/docs/internals/journal.md +++ /dev/null @@ -1,99 +0,0 @@ -Journal -======= - - -Data Model ----------- -```mermaid -classDiagram -User .. Piece - -class Piece { - +User owner - +int visibility -} - -class Item { - +str title - +str brief - -enum type -} -Piece <|-- Content -Item .. Content -class Content { - +Item target -} -Content <|-- Rating -class Rating { - +int grade -} -Content <|-- Review -class Review { - +str title - +str body -} -Content <|-- Comment -class Comment { - +str text -} -Content <|-- Note -class Note { - +str title - +str content - +enum progress_type - +str progress_value - -} -Content <|-- Reply -class Reply { - +Content reply_to -} -Piece <|-- List -class List{ - +ListItem[] items -} -Item .. ListItem -List *-- ListItem -class ListItem { - +int position - +Item item - +Dict metadata -} -List <|-- Collection -Item .. Collection -class Collection { - +str title - +str brief - +Bool collabrative -} -List <|-- Tag -class Tag { - +str title -} -List <|-- Shelf -class Shelf { - +Enum type -} -User .. ShelfLogManager -class ShelfLogManager { - +User owner - +ShelfLogEntry[] logs -} -ShelfLogManager *-- ShelfLogEntry -class ShelfLogEntry { - +Item item - +Shelf shelf - +DateTime timestamp -} -ShelfLogEntry .. Item -ShelfLogEntry .. Shelf - -Shelf *-- ShelfItem -ListItem <|-- ShelfItem - -ListItem <|-- TagItem -ListItem <|-- CollectionItem - -Tag *-- TagItem -Collection *-- CollectionItem -``` diff --git a/docs/internals/social.md b/docs/internals/social.md deleted file mode 100644 index 8784aeec..00000000 --- a/docs/internals/social.md +++ /dev/null @@ -1,100 +0,0 @@ -Social -====== - -Data Modal ----------- -```mermaid -classDiagram -User .. Piece - -class Piece { - +User owner - +int visibility -} -User .. Activity -class Activity { - +User owner - +int visibility - +Piece action_object -} -Activity .. Piece -Activity .. Item -class Item { - +str title - +str brief - -enum type -} -``` - -Activities ----------- -Activity data may be used for: - 1. time line view of user and her friends - 2. chronological view of user's action about an item - 3. ActivityStreams `OrderedCollection` for ActivityPub - -However, 2 is currently implemented separately via `ShelfLogManager` in `journal` app, because users may want to change these records manually. - -Local Timeline --------------- -| Local Timeline Activities | action object class | -| ------------------------- | ------------------- | -| Add an Item to Shelf | ShelfMember | -| Create a Collection | Collection | -| Like a Collection | Like | -| Create a Review | Review | - - -Activity Streams ----------------- -These are list of activities should be either shown in the site or delivered as ActivityStreams or both: - - - `Add` / `Remove` an *Item* to / from a *List*: - + add / remove *Item* to / from a user *Collection* - + mark *Item* as wishlist / progress / complete, which are essentially add to / remove from user's predefined *Collection* - - `Create` / `Update` / `Delete` a user *Collection* - - `Create` / `Update` / `Delete` a *Content* with an `Object Link` to *Item* - + `Create` / `Update` / `Delete` a *Comment* or *Review* - + `Create` / `Update` / `Delete` a *Quote* or *Note* - - `Create` / `Update` / `Delete` a *Reply* to another *Content* - - `Announce` / `Like` a *Content* / *Collection*, or `Undo` that - - Social Graph interaction - + `Follow`/`Unfo` `Follow` - + `Accept`/`Reject` - + `Block`/`Undo` `Block` - -Supporting these activities above will be essential to a reasonable ActivityPub server implementation. - -There are additional activities not made into ActivityPub MVP but technically possible to support in future: - - `Create` / `Update` / `Delete` a *Content* in different flavors, without link to *Item* - * `Note` or `Article` without link to *Item* - * DM (`Note`) - * `Question` - * `Article` - * `Page` - * `Image` - * `Audio` - * `Video` - * `Event` - - `Add` `Content` to / `Remove` `Content` from a user *Collection* - * *Pin* / *Unpin* - - `Move`/`Delete` account - -ActivityPub ------------ - -TBA - -References: - - https://www.w3.org/TR/activitypub/ - - https://www.w3.org/TR/activitystreams-core/ - - https://www.w3.org/TR/activitystreams-vocabulary/ - - https://www.w3.org/TR/json-ld/ - - https://codeberg.org/fediverse/fep/src/branch/main/feps/fep-e232.md - - https://socialhub.activitypub.rocks/t/guide-for-new-activitypub-implementers/479 - - https://docs.joinmastodon.org/spec/activitypub/ - - https://docs.joinbookwyrm.com/activitypub.html - - https://github.com/Podcastindex-org/podcast-namespace/blob/main/proposal-docs/social/social.md#socialinteract-element - - https://dev.funkwhale.audio/funkwhale/funkwhale/-/tree/develop/docs/developer_documentation/federation - - https://github.com/inventaire/inventaire/issues/187 - - https://github.com/inventaire/inventaire/issues/533 diff --git a/docs/origin.md b/docs/origin.md deleted file mode 100644 index 1e8a992e..00000000 --- a/docs/origin.md +++ /dev/null @@ -1,16 +0,0 @@ -Our Story -========= - -Established in September 2021, NeoDB is an [open source project](https://github.com/neodb-social/neodb) and [free service](https://neodb.social/) to help users around the world share and discover reviews and ratings of books, movies, music and games in Fediverse without concern of tracking or censorship. - - -The community that we serve today are mostly those previously used social networks in China to share their reviews and ratings for book, movie and music. By doing so for the last 15 years, they have made these reviews a rich form of archive that is the container of personal stories, intellectual debates, political opinions, and more. However, in recent years many of them got suppressed and banned due to increasing censorship and authoritarian laws in China. Many users have lost trust in proprietary software and services in China. NeoDB started as a humble effort to build open source software and services to help these internet refugees recreate their social network identity, regain control of their own content, and share their discoveries and opinions with their friends freely in Fediverse and, thanks to the openness of ActivityPub, the whole world. - - -As we’ve gained some [initial attraction](https://blog.joinmastodon.org/2021/12/mastodon-recap-2021/), we expect to continue supporting this fast growing community with better portability, security and user experience, we also hope to connect our community with broader Fediverse users with diverse backgrounds and serve both via enhanced a16y and i18n, decentralized architecture and interchangeable data format and protocols on catalogue information and user generated content. Your support and donation will help us operate continuously and develop towards this vision with more confidence. - - -NeoDB is a fork of [NiceDB](https://github.com/doubaniux/boofilsic), our code is actively being developed and is open-sourced under the AGPL-v3 license. We highly welcome contributions in code, design, and localization. - - -Please follow us on Fediverse([en](https://mastodon.online/@neodb)|[cn](https://mastodon.social/@neodb)) / [Bluesky](https://bsky.app/profile/neodb.net) / [Twitter](https://x.com/NeoDBsocial), and help spread the words. Thank you for the support! diff --git a/docs/servers.json b/docs/servers.json deleted file mode 100644 index 08290ce4..00000000 --- a/docs/servers.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "version": "1.0", - "servers": [ - { - "host": "neodb.social", - "description": "Flagship instance, managed by NeoDB developers.", - "label": [ - "flagship" - ], - "language": [ - "zh", - "en" - ] - }, - { - "name": "NeoDB experimental", - "host": "eggplant.place", - "description": "Instance running development version of NeoDB software, which may have newer features and occationally bugs, managed by NeoDB developers.", - "label": [ - "beta" - ], - "language": [ - "en" - ] - }, - { - "name": "ReviewDB", - "host": "neodb.social", - "admin": [ - "@shlee@aus.social" - ], - "language": [ - "en" - ] - }, - { - "name": "Minreol", - "host": "minreol.dk", - "admin": [ - "@pmakholm@norrebro.space" - ], - "language": [ - "da" - ] - }, - { - "name": "CasDB", - "host": "db.casually.cat", - "admin": [ - "@casuallynoted@casually.cat" - ], - "language": [ - "en" - ] - }, - { - "name": "KevGa-NeoDB", - "host": "neodb.kevga.de", - "admin": [ - "@lorker@mastodon.kevga.de" - ], - "language": [ - "de" - ] - } - ] -} diff --git a/docs/servers.md b/docs/servers.md deleted file mode 100644 index 82170f43..00000000 --- a/docs/servers.md +++ /dev/null @@ -1,21 +0,0 @@ -# Servers - - -## Community instances - -NeoDB is not a single website. To use it, you need to sign up on an instance, that lets you connect with other people using NeoDB across Fediverse and Bluesky. - -{servers} - -JSON version of this list is also available [here](servers.json). If you are hosting a public instance of NeoDB and wish to share that with the community, please [edit this file](https://github.com/neodb-social/neodb/edit/main/docs/servers.json) and submit a pull request. - -To host your own instance of NeoDB, see [installation guide](install.md). - - -## Public relay hosted by NeoDB developers - - - `relay.neodb.net` - NeoDB instances may connect to this relay to send and receive public posts, this is to help share items, ratings and reviews in the network, more on this in [configuration doc](configuration.md). - - -## Honorable mention - - [NiceDB](https://nicedb.org) - the original instance, no longer open for registration. diff --git a/docs/sites.md b/docs/sites.md deleted file mode 100644 index 78f981e6..00000000 --- a/docs/sites.md +++ /dev/null @@ -1,27 +0,0 @@ -# Supported Sites - -the following sites are supported - - -| | import link for media type | import archive | -| ----------------------| ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | -| Apple Music | Music (Album) | | -| Archive of Our Own | Book (Edition) | | -| Bandcamp | Music (Album) | | -| Bangumi | Book (Edition)
Music (Album)
Movie
TV (Season)
Game | | -| Board Game Geek | Game | | -| BooksTW 博客來 | Book (Edition) | | -| Discogs | Music (Album) | | -| Douban 豆瓣 | Book (Edition, Work)
Music (Album)
Movie
TV (Show, Season, Episode)
Game
Performance (Performance, Production) | Yes, upload [doufen](https://doufen.org) archive | -| Goodreads | Book (Edition, Work) | Yes, submit profile or shelf link | -| Google Books | Book (Edition) | | -| IGDB | Game | | -| IMDB | Movie
TV (Show, Episode) | | -| jjwxc 晋江文学城 | Book (Edition) | | -| Letterboxd | not supported (link in archive is mapped to TMDB) | Yes, upload exported archive | -| Qidian 起点 | Book (Edition) | | -| Spotify | Music (Album) | | -| Steam | Game | | -| The Movie Database | Movie
TV (Show, Season, Episode) | | -| ypshuo 阅评说 | Book (Edition) | | -| RSS link to a podcast | Podcast | Yes, upload OPML | diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css deleted file mode 100644 index 283aadea..00000000 --- a/docs/stylesheets/extra.css +++ /dev/null @@ -1,14 +0,0 @@ -:root { - --md-primary-fg-color: #0172ad; - --md-primary-fg-color--light: #0172ad; - --md-primary-fg-color--dark: #0172ad; - --md-accent-fg-color: #01aaff; - --md-accent-fg-color--light: #01aaff; - --md-accent-fg-color--dark: #01aaff; - font-family:system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; -} -@media screen and (min-width: 76.25em) { - .md-nav__title { - display: none; - } -} diff --git a/docs/templates/main.html b/docs/templates/main.html deleted file mode 100644 index 869f169f..00000000 --- a/docs/templates/main.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "base.html" %} -{% block extrahead %} - - -{% endblock %} diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md deleted file mode 100644 index 585d68e2..00000000 --- a/docs/troubleshooting.md +++ /dev/null @@ -1,56 +0,0 @@ -# Troubleshooting - - -## Tips - - - `docker compose ps` to see if any service is down, (btw it's normal that `migration` is in `Exit 0` state) - - `docker compose run shell` to run a shell into the cluster; or `docker compose run root` for root shell, and `apt` is available if extra package needed - - see `Debug in Docker` in [development doc](development.md) for debugging tips - - -## Containers - -a typical neodb cluster looks like: - -```mermaid -flowchart TB - web[[Your reverse proxy server with SSL]] --- neodb-nginx[nginx listening on localhost:8000] - subgraph Containers managed by compose.yml - neodb-nginx --- neodb-web - neodb-nginx --- takahe-web - neodb-worker --- typesense[(typesense)] - neodb-worker --- neodb-db[(neodb-db)] - neodb-worker --- redis[(redis)] - neodb-web --- typesense - neodb-web --- neodb-db - neodb-web --- redis - neodb-web --- takahe-db[(takahe-db)] - migration([migration]) --- neodb-db - migration --- takahe-db - takahe-web --- takahe-db - takahe-web --- redis - takahe-stator --- takahe-db - takahe-stator --- redis - end -``` - - -## Data Folders - -a typical neodb folder after starting up should look like: - -``` -mysite -├── data # neodb data folder, location can be changed via NEODB_DATA in .env -│ ├── neodb-db # neodb database -│ ├── neodb-media # uid must be 1000 (app user in docker image), chmod if not so -│ ├── redis # neodb/takahe cache -│ ├── takahe-cache # uid must be 33 (www-data user in docker image), chmod if not so -│ ├── takahe-db # neodb database -│ ├── takahe-media # uid must be 1000 (app user in docker image), chmod if not so -│ ├── typesense # neodb search index -│ └── www-root # neodb web root for robots.txt, logo.png and etc -└── config - ├── compose.yml # copied from neodb release - └── .env # your configuration, see neodb.env.example -``` diff --git a/docs/upgrade.md b/docs/upgrade.md deleted file mode 100644 index c6350205..00000000 --- a/docs/upgrade.md +++ /dev/null @@ -1,21 +0,0 @@ -Upgrade -======= - -Check the [release notes](https://github.com/neodb-social/neodb/releases), update `compose.yml` and `.env` as instructed. - -If there is `compose.override.yml`, make sure it's compatible with the updated `compose.yml`. - -Pull the latest container image -```bash -docker compose --profile production pull -``` - -Restart the entire cluster: -```bash -docker compose --profile production up -d -``` - -Optionally, clean up old images: -```bash -docker system prune -af --volumes -``` diff --git a/journal/importers/letterboxd.py b/journal/importers/letterboxd.py index 4e76c5b0..8fb42ea8 100644 --- a/journal/importers/letterboxd.py +++ b/journal/importers/letterboxd.py @@ -43,16 +43,17 @@ class LetterboxdImporter(Task): except Exception: return False - def get_item_by_url(self, url): + @classmethod + def get_item_by_url(cls, url): try: h = BasicDownloader(url).download().html() - tu = h.xpath("//a[@data-track-action='TMDb']/@href") + tu = h.xpath("//a[@data-track-action='TMDB']/@href") iu = h.xpath("//a[@data-track-action='IMDb']/@href") if not tu: i = h.xpath('//span[@class="film-title-wrapper"]/a/@href') u2 = "https://letterboxd.com" + i[0] # type:ignore h = BasicDownloader(u2).download().html() - tu = h.xpath("//a[@data-track-action='TMDb']/@href") + tu = h.xpath("//a[@data-track-action='TMDB']/@href") iu = h.xpath("//a[@data-track-action='IMDb']/@href") if not tu: logger.error(f"Unknown TMDB for {url}") diff --git a/journal/models/index.py b/journal/models/index.py index f9374f79..ab1d68a1 100644 --- a/journal/models/index.py +++ b/journal/models/index.py @@ -178,7 +178,11 @@ class JournalSearchResult(SearchResult): [], ) ) - items = Item.objects.filter(pk__in=ids, is_deleted=False) + select = {f"id_{i}": f"id={i}" for i in ids} + order = [f"-id_{i}" for i in ids] + items = Item.objects.filter(pk__in=ids, is_deleted=False).extra( + select=select, order_by=order + ) items = [j for j in [i.final_item for i in items] if not j.is_deleted] return items @@ -197,7 +201,9 @@ class JournalSearchResult(SearchResult): ], [], ) - ps = Piece.objects.filter(pk__in=ids) + select = {f"id_{i}": f"id={i}" for i in ids} + order = [f"-id_{i}" for i in ids] + ps = Piece.objects.filter(pk__in=ids).extra(select=select, order_by=order) return ps @cached_property diff --git a/journal/models/mark.py b/journal/models/mark.py index d91a1c67..4cce6614 100644 --- a/journal/models/mark.py +++ b/journal/models/mark.py @@ -163,7 +163,7 @@ class Mark: log entries log entry will be created when item is added to shelf log entry will be created when item is moved to another shelf - log entry will be created when item is removed from shelf (TODO change this to DEFERRED shelf) + log entry will be created when item is removed from shelf timestamp of log entry will be updated whenever created_time of shelfmember is updated any log entry can be deleted by user arbitrarily diff --git a/journal/models/rating.py b/journal/models/rating.py index 4ccfbe98..d0319de9 100644 --- a/journal/models/rating.py +++ b/journal/models/rating.py @@ -5,14 +5,14 @@ from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.db.models import Avg, Count -from catalog.models import Item +from catalog.models import Item, Performance, TVShow from takahe.utils import Takahe from users.models import APIdentity from .common import Content MIN_RATING_COUNT = 5 -RATING_INCLUDES_CHILD_ITEMS = ["tvshow", "performance"] +RATING_INCLUDES_CHILD_ITEMS = [TVShow, Performance] class Rating(Content): @@ -73,10 +73,41 @@ class Rating(Content): p.link_post_id(post.id) return p + @classmethod + def get_info_for_item(cls, item: Item) -> dict: + stat = Rating.objects.filter(grade__isnull=False) + if item.__class__ in RATING_INCLUDES_CHILD_ITEMS: + stat = stat.filter(item_id__in=item.child_item_ids + [item.pk]) + else: + stat = stat.filter(item=item) + stat = stat.values("grade").annotate(count=Count("grade")) + grades = [0] * 11 + votes = 0 + total = 0 + for s in stat: + if s["grade"] and s["grade"] > 0 and s["grade"] < 11: + grades[s["grade"]] = s["count"] + total += s["count"] * s["grade"] + votes += s["count"] + if votes < MIN_RATING_COUNT: + return {"average": None, "count": votes, "distribution": [0] * 5} + else: + return { + "average": round(total / votes, 1), + "count": votes, + "distribution": [ + 100 * (grades[1] + grades[2]) // votes, + 100 * (grades[3] + grades[4]) // votes, + 100 * (grades[5] + grades[6]) // votes, + 100 * (grades[7] + grades[8]) // votes, + 100 * (grades[9] + grades[10]) // votes, + ], + } + @staticmethod def get_rating_for_item(item: Item) -> float | None: stat = Rating.objects.filter(grade__isnull=False) - if item.class_name in RATING_INCLUDES_CHILD_ITEMS: + if item.__class__ in RATING_INCLUDES_CHILD_ITEMS: stat = stat.filter(item_id__in=item.child_item_ids + [item.pk]) else: stat = stat.filter(item=item) @@ -86,7 +117,7 @@ class Rating(Content): @staticmethod def get_rating_count_for_item(item: Item) -> int: stat = Rating.objects.filter(grade__isnull=False) - if item.class_name in RATING_INCLUDES_CHILD_ITEMS: + if item.__class__ in RATING_INCLUDES_CHILD_ITEMS: stat = stat.filter(item_id__in=item.child_item_ids + [item.pk]) else: stat = stat.filter(item=item) @@ -96,7 +127,7 @@ class Rating(Content): @staticmethod def get_rating_distribution_for_item(item: Item): stat = Rating.objects.filter(grade__isnull=False) - if item.class_name in RATING_INCLUDES_CHILD_ITEMS: + if item.__class__ in RATING_INCLUDES_CHILD_ITEMS: stat = stat.filter(item_id__in=item.child_item_ids + [item.pk]) else: stat = stat.filter(item=item) diff --git a/journal/models/renderers.py b/journal/models/renderers.py index c685696e..d63aa951 100644 --- a/journal/models/renderers.py +++ b/journal/models/renderers.py @@ -50,6 +50,10 @@ def html_to_text(h: str) -> str: ) +def has_spoiler(s: str) -> bool: + return ">!" in s + + def _spolier(s: str) -> str: sl = s.split(">!", 1) if len(sl) == 1: diff --git a/journal/models/shelf.py b/journal/models/shelf.py index 68eb4074..71535e92 100644 --- a/journal/models/shelf.py +++ b/journal/models/shelf.py @@ -7,6 +7,7 @@ from django.db import connection, models from django.utils import timezone from django.utils.translation import gettext_lazy as _ from loguru import logger +from polymorphic.models import PolymorphicManager from catalog.models import Item, ItemCategory from takahe.utils import Takahe @@ -310,6 +311,28 @@ _SHELF_LABELS = [ # grammatically problematic, for translation only +class ShelfMemberManager(PolymorphicManager): + def get_queryset(self): + from .comment import Comment + from .rating import Rating + + rating_subquery = Rating.objects.filter( + owner_id=models.OuterRef("owner_id"), item_id=models.OuterRef("item_id") + ).values("grade")[:1] + comment_subquery = Comment.objects.filter( + owner_id=models.OuterRef("owner_id"), item_id=models.OuterRef("item_id") + ).values("text")[:1] + return ( + super() + .get_queryset() + .annotate( + _rating_grade=models.Subquery(rating_subquery), + _comment_text=models.Subquery(comment_subquery), + _shelf_type=models.F("parent__shelf_type"), + ) + ) + + class ShelfMember(ListMember): if TYPE_CHECKING: parent: models.ForeignKey["ShelfMember", "Shelf"] @@ -318,6 +341,8 @@ class ShelfMember(ListMember): "Shelf", related_name="members", on_delete=models.CASCADE ) + objects = ShelfMemberManager() + class Meta: unique_together = [["owner", "item"]] indexes = [ @@ -448,6 +473,15 @@ class ShelfMember(ListMember): "content": content, } + def save(self, *args, **kwargs): + try: + del self._shelf_type # type:ignore + del self._rating_grade # type:ignore + del self._comment_text # type:ignore + except AttributeError: + pass + return super().save(*args, **kwargs) + @cached_property def sibling_comment(self) -> "Comment | None": from .comment import Comment @@ -470,19 +504,28 @@ class ShelfMember(ListMember): @property def shelf_label(self) -> str | None: - return ShelfManager.get_label(self.parent.shelf_type, self.item.category) + return ShelfManager.get_label(self.shelf_type, self.item.category) @property def shelf_type(self): - return self.parent.shelf_type + try: + return getattr(self, "_shelf_type") + except AttributeError: + return self.parent.shelf_type @property def rating_grade(self): - return self.mark.rating_grade + try: + return getattr(self, "_rating_grade") + except AttributeError: + return self.mark.rating_grade @property def comment_text(self): - return self.mark.comment_text + try: + return getattr(self, "_comment_text") + except AttributeError: + return self.mark.comment_text @property def tags(self): diff --git a/journal/templates/_sidebar_search_journal.html b/journal/templates/_sidebar_search_journal.html index 4dae5d15..7c4cbf1d 100644 --- a/journal/templates/_sidebar_search_journal.html +++ b/journal/templates/_sidebar_search_journal.html @@ -1,7 +1,7 @@ {% load i18n %} diff --git a/journal/tests/__init__.py b/journal/tests/__init__.py index f3bf6f07..a9a9f732 100644 --- a/journal/tests/__init__.py +++ b/journal/tests/__init__.py @@ -1,4 +1,5 @@ from .csv import * from .ndjson import * from .piece import * +from .rating import * from .search import * diff --git a/journal/tests/piece.py b/journal/tests/piece.py index 96d3696d..55572a3b 100644 --- a/journal/tests/piece.py +++ b/journal/tests/piece.py @@ -65,23 +65,34 @@ class ShelfTest(TestCase): self.assertEqual(q1.members.all().count(), 0) self.assertEqual(q2.members.all().count(), 0) Mark(user.identity, book1).update(ShelfType.WISHLIST) - time.sleep(0.001) # add a little delay to make sure the timestamp is different Mark(user.identity, book2).update(ShelfType.WISHLIST) + log = [ll.shelf_type for ll in shelf_manager.get_log_for_item(book1)] + self.assertEqual(log, ["wishlist"]) + log = [ll.shelf_type for ll in shelf_manager.get_log_for_item(book2)] + self.assertEqual(log, ["wishlist"]) + time.sleep(0.001) # add a little delay to make sure the timestamp is different + + Mark(user.identity, book1).update(ShelfType.WISHLIST) + log = [ll.shelf_type for ll in shelf_manager.get_log_for_item(book1)] + self.assertEqual(log, ["wishlist"]) time.sleep(0.001) + self.assertEqual(q1.members.all().count(), 2) Mark(user.identity, book1).update(ShelfType.PROGRESS) - time.sleep(0.001) self.assertEqual(q1.members.all().count(), 1) self.assertEqual(q2.members.all().count(), 1) + time.sleep(0.001) + self.assertEqual(len(Mark(user.identity, book1).all_post_ids), 2) - log = shelf_manager.get_log_for_item(book1) - self.assertEqual(log.count(), 2) + log = [ll.shelf_type for ll in shelf_manager.get_log_for_item(book1)] + + self.assertEqual(log, ["wishlist", "progress"]) Mark(user.identity, book1).update(ShelfType.PROGRESS, metadata={"progress": 1}) time.sleep(0.001) self.assertEqual(q1.members.all().count(), 1) self.assertEqual(q2.members.all().count(), 1) - log = shelf_manager.get_log_for_item(book1) - self.assertEqual(log.count(), 2) + log = [ll.shelf_type for ll in shelf_manager.get_log_for_item(book1)] + self.assertEqual(log, ["wishlist", "progress"]) self.assertEqual(len(Mark(user.identity, book1).all_post_ids), 2) # theses tests are not relevant anymore, bc we don't use log to track metadata changes @@ -127,7 +138,8 @@ class ShelfTest(TestCase): # test delete mark -> one more log Mark(user.identity, book1).delete() - self.assertEqual(log.count(), 4) + log = [ll.shelf_type for ll in shelf_manager.get_log_for_item(book1)] + self.assertEqual(log, ["wishlist", "progress", "complete", None]) deleted_mark = Mark(user.identity, book1) self.assertEqual(deleted_mark.shelf_type, None) self.assertEqual(deleted_mark.tags, []) diff --git a/journal/tests/rating.py b/journal/tests/rating.py new file mode 100644 index 00000000..b6d4f8fc --- /dev/null +++ b/journal/tests/rating.py @@ -0,0 +1,201 @@ +from django.test import TestCase + +from catalog.common.models import Item +from catalog.models import Edition, IdType, Movie, TVEpisode, TVSeason, TVShow +from journal.models.rating import Rating +from users.models import User + + +class RatingTest(TestCase): + databases = "__all__" + + def setUp(self): + # Create 10 users + self.users = [] + for i in range(10): + user = User.register(email=f"user{i}@example.com", username=f"user{i}") + self.users.append(user) + + # Create a book + self.book = Edition.objects.create( + localized_title=[{"lang": "en", "text": "Test Book"}], + primary_lookup_id_type=IdType.ISBN, + primary_lookup_id_value="9780553283686", + author=["Test Author"], + ) + + # Create a movie + self.movie = Movie.objects.create( + localized_title=[{"lang": "en", "text": "Test Movie"}], + primary_lookup_id_type=IdType.IMDB, + primary_lookup_id_value="tt1234567", + director=["Test Director"], + year=2020, + ) + + # Create a TV show with a season and episode + self.tvshow = TVShow.objects.create( + localized_title=[{"lang": "en", "text": "Test Show"}], + primary_lookup_id_type=IdType.IMDB, + primary_lookup_id_value="tt9876543", + ) + self.tvseason = TVSeason.objects.create( + localized_title=[{"lang": "en", "text": "Season 1"}], + show=self.tvshow, + season_number=1, + ) + self.tvepisode = TVEpisode.objects.create( + localized_title=[{"lang": "en", "text": "Episode 1"}], + season=self.tvseason, + episode_number=1, + ) + + def test_rating_basic(self): + """Test basic rating functionality for a single item.""" + # Add ratings for the book from all users + ratings = [7, 8, 9, 10, 8, 7, 6, 9, 10, 8] + + for i, user in enumerate(self.users): + Rating.update_item_rating( + self.book, user.identity, ratings[i], visibility=1 + ) + + # Get rating info for the book + rating_info = Rating.get_info_for_item(self.book) + + # Check rating count + self.assertEqual(rating_info["count"], 10) + + # Check average rating - should be 8.2 + expected_avg = sum(ratings) / len(ratings) + self.assertEqual(rating_info["average"], round(expected_avg, 1)) + + # Check distribution + # [1-2, 3-4, 5-6, 7-8, 9-10] buckets represented as percentages + expected_distribution = [0, 0, 10, 50, 40] # Based on our ratings + self.assertEqual(rating_info["distribution"], expected_distribution) + + # Test individual user rating + user_rating = Rating.get_item_rating(self.book, self.users[0].identity) + self.assertEqual(user_rating, 7) + + book = Item.objects.get(pk=self.book.pk) + self.assertEqual(book.rating, round(expected_avg, 1)) + self.assertEqual(book.rating_count, 10) + self.assertEqual(book.rating_distribution, expected_distribution) + + def test_rating_multiple_items(self): + """Test ratings across multiple items.""" + # Rate the movie with varying scores + movie_ratings = [3, 4, 5, 6, 7, 8, 9, 10, 2, 1] + + for i, user in enumerate(self.users): + Rating.update_item_rating( + self.movie, user.identity, movie_ratings[i], visibility=1 + ) + + # Rate the TV show + tvshow_ratings = [10, 9, 8, 9, 10, 9, 8, 10, 9, 8] + + for i, user in enumerate(self.users): + Rating.update_item_rating( + self.tvshow, user.identity, tvshow_ratings[i], visibility=1 + ) + + # Get rating info for both items + movie_info = Rating.get_info_for_item(self.movie) + tvshow_info = Rating.get_info_for_item(self.tvshow) + + # Check counts + self.assertEqual(movie_info["count"], 10) + self.assertEqual(tvshow_info["count"], 10) + + # Check averages + expected_movie_avg = sum(movie_ratings) / len(movie_ratings) + expected_tvshow_avg = sum(tvshow_ratings) / len(tvshow_ratings) + + self.assertEqual(movie_info["average"], round(expected_movie_avg, 1)) + self.assertEqual(tvshow_info["average"], round(expected_tvshow_avg, 1)) + + # Check distribution for movie + # [1-2, 3-4, 5-6, 7-8, 9-10] buckets + expected_movie_distribution = [ + 20, + 20, + 20, + 20, + 20, + ] # Evenly distributed across buckets + self.assertEqual(movie_info["distribution"], expected_movie_distribution) + + # Check distribution for TV show + # [1-2, 3-4, 5-6, 7-8, 9-10] buckets + expected_tvshow_distribution = [0, 0, 0, 30, 70] # High ratings only + self.assertEqual(tvshow_info["distribution"], expected_tvshow_distribution) + + def test_rating_update_and_delete(self): + """Test updating and deleting ratings.""" + # Add initial ratings + for user in self.users[:5]: + Rating.update_item_rating(self.tvepisode, user.identity, 8, visibility=1) + + # Check initial count + self.assertEqual(Rating.get_rating_count_for_item(self.tvepisode), 5) + + # Update a rating + Rating.update_item_rating( + self.tvepisode, self.users[0].identity, 10, visibility=1 + ) + + # Check that rating was updated + updated_rating = Rating.get_item_rating(self.tvepisode, self.users[0].identity) + self.assertEqual(updated_rating, 10) + + # Delete a rating by setting it to None + Rating.update_item_rating( + self.tvepisode, self.users[1].identity, None, visibility=1 + ) + + # Check that rating count decreased + self.assertEqual(Rating.get_rating_count_for_item(self.tvepisode), 4) + + # Check that the rating was deleted + deleted_rating = Rating.get_item_rating(self.tvepisode, self.users[1].identity) + self.assertIsNone(deleted_rating) + + def test_rating_minimum_count(self): + """Test the minimum rating count threshold.""" + # Add only 4 ratings to the book (below MIN_RATING_COUNT of 5) + for user in self.users[:4]: + Rating.update_item_rating(self.book, user.identity, 10, visibility=1) + + # Check that get_rating_for_item returns None due to insufficient ratings + rating = Rating.get_rating_for_item(self.book) + self.assertIsNone(rating) + + # Add one more rating to reach the threshold + Rating.update_item_rating(self.book, self.users[4].identity, 10, visibility=1) + + # Now we should get a valid rating + rating = Rating.get_rating_for_item(self.book) + self.assertEqual(rating, 10.0) + + def test_tvshow_rating_includes_children(self): + """Test that TV show ratings include ratings from child items.""" + # Rate the TV show directly + Rating.update_item_rating(self.tvshow, self.users[0].identity, 6, visibility=1) + + # Rate the episode (which is a child of the TV show) + for i in range(1, 6): # Users 1-5 + Rating.update_item_rating( + self.tvseason, self.users[i].identity, 10, visibility=1 + ) + + # Get info for TV show - should include ratings from episode + tvshow_info = Rating.get_info_for_item(self.tvshow) + + # Check count (1 for show + 5 for episode = 6) + self.assertEqual(tvshow_info["count"], 6) + + # The average should consider all ratings (6 + 5*10 = 56, divided by 6 = 9.3) + self.assertEqual(tvshow_info["average"], 9.3) diff --git a/journal/views/review.py b/journal/views/review.py index 3f4bfa1e..06f6330d 100644 --- a/journal/views/review.py +++ b/journal/views/review.py @@ -14,7 +14,7 @@ from django.views.decorators.http import require_http_methods from catalog.models import * from common.utils import AuthedHttpRequest, get_uuid_or_404 -from journal.models.renderers import convert_leading_space_in_md, render_md +from journal.models.renderers import convert_leading_space_in_md, has_spoiler, render_md from users.middlewares import activate_language_for_user from users.models.apidentity import APIdentity @@ -135,9 +135,12 @@ class ReviewFeed(Feed): return reviews def item_title(self, item: Review): - return _("{review_title} - a review of {item_title}").format( + s = _("{review_title} - a review of {item_title}").format( review_title=item.title, item_title=item.item.title ) + if has_spoiler(item.body): + s += " (" + _("may contain spoiler or triggering content") + ")" + return s def item_description(self, item: Review): target_html = ( diff --git a/locale/django.pot b/locale/django.pot index 28c12d2c..e59746fb 100644 --- a/locale/django.pot +++ b/locale/django.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-03-02 14:00-0500\n" +"POT-Creation-Date: 2025-03-10 02:19-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -90,15 +90,15 @@ msgid "subtitle" msgstr "" #: catalog/book/models.py:168 catalog/movie/models.py:65 -#: catalog/performance/models.py:256 catalog/tv/models.py:134 -#: catalog/tv/models.py:301 +#: catalog/performance/models.py:256 catalog/tv/models.py:135 +#: catalog/tv/models.py:302 msgid "original title" msgstr "" #: catalog/book/models.py:172 catalog/game/models.py:72 #: catalog/movie/models.py:68 catalog/music/models.py:88 #: catalog/performance/models.py:114 catalog/performance/models.py:259 -#: catalog/tv/models.py:138 catalog/tv/models.py:304 +#: catalog/tv/models.py:139 catalog/tv/models.py:305 msgid "other title" msgstr "" @@ -448,7 +448,7 @@ msgstr "" msgid "FanFic" msgstr "" -#: catalog/common/models.py:333 catalog/tv/models.py:381 +#: catalog/common/models.py:333 catalog/tv/models.py:382 #: users/models/user.py:113 msgid "language" msgstr "" @@ -560,7 +560,7 @@ msgid "date of publication" msgstr "" #: catalog/game/models.py:120 catalog/music/models.py:59 -#: catalog/tv/models.py:185 +#: catalog/tv/models.py:186 msgid "YYYY-MM-DD" msgstr "" @@ -570,7 +570,7 @@ msgstr "" #: catalog/game/models.py:131 catalog/movie/models.py:96 #: catalog/performance/models.py:121 catalog/podcast/models.py:58 -#: catalog/tv/models.py:165 catalog/tv/models.py:332 +#: catalog/tv/models.py:166 catalog/tv/models.py:333 msgid "genre" msgstr "" @@ -584,26 +584,26 @@ msgstr "" #: catalog/templates/movie.html:58 catalog/templates/performance.html:33 #: catalog/templates/performanceproduction.html:33 #: catalog/templates/podcast.html:20 catalog/templates/tvseason.html:75 -#: catalog/templates/tvshow.html:70 catalog/tv/models.py:199 -#: catalog/tv/models.py:367 +#: catalog/templates/tvshow.html:70 catalog/tv/models.py:200 +#: catalog/tv/models.py:368 msgid "website" msgstr "" #: catalog/movie/models.py:75 catalog/performance/models.py:129 -#: catalog/performance/models.py:267 catalog/tv/models.py:144 -#: catalog/tv/models.py:311 +#: catalog/performance/models.py:267 catalog/tv/models.py:145 +#: catalog/tv/models.py:312 msgid "director" msgstr "" #: catalog/movie/models.py:82 catalog/performance/models.py:136 -#: catalog/performance/models.py:274 catalog/tv/models.py:151 -#: catalog/tv/models.py:318 +#: catalog/performance/models.py:274 catalog/tv/models.py:152 +#: catalog/tv/models.py:319 msgid "playwright" msgstr "" #: catalog/movie/models.py:89 catalog/performance/models.py:164 -#: catalog/performance/models.py:302 catalog/tv/models.py:158 -#: catalog/tv/models.py:325 +#: catalog/performance/models.py:302 catalog/tv/models.py:159 +#: catalog/tv/models.py:326 msgid "actor" msgstr "" @@ -615,32 +615,32 @@ msgstr "" msgid "release date" msgstr "" -#: catalog/movie/models.py:115 catalog/tv/models.py:351 +#: catalog/movie/models.py:115 catalog/tv/models.py:352 #: journal/templates/_sidebar_user_mark_list.html:62 msgid "date" msgstr "" #: catalog/movie/models.py:116 catalog/performance/models.py:81 -#: catalog/tv/models.py:352 +#: catalog/tv/models.py:353 msgid "required" msgstr "" -#: catalog/movie/models.py:120 catalog/tv/models.py:356 +#: catalog/movie/models.py:120 catalog/tv/models.py:357 msgid "region or event" msgstr "" -#: catalog/movie/models.py:122 catalog/tv/models.py:191 -#: catalog/tv/models.py:358 +#: catalog/movie/models.py:122 catalog/tv/models.py:192 +#: catalog/tv/models.py:359 msgid "Germany or Toronto International Film Festival" msgstr "" -#: catalog/movie/models.py:132 catalog/tv/models.py:201 -#: catalog/tv/models.py:370 +#: catalog/movie/models.py:132 catalog/tv/models.py:202 +#: catalog/tv/models.py:371 msgid "region" msgstr "" -#: catalog/movie/models.py:143 catalog/tv/models.py:213 -#: catalog/tv/models.py:391 +#: catalog/movie/models.py:143 catalog/tv/models.py:214 +#: catalog/tv/models.py:392 msgid "year" msgstr "" @@ -797,10 +797,10 @@ msgstr "" msgid "comment this episode" msgstr "" -#: catalog/templates/_item_reviews.html:26 journal/models/shelf.py:71 -#: journal/models/shelf.py:111 journal/models/shelf.py:151 -#: journal/models/shelf.py:191 journal/models/shelf.py:231 -#: journal/models/shelf.py:271 journal/models/shelf.py:305 +#: catalog/templates/_item_reviews.html:26 journal/models/shelf.py:72 +#: journal/models/shelf.py:112 journal/models/shelf.py:152 +#: journal/models/shelf.py:192 journal/models/shelf.py:232 +#: journal/models/shelf.py:272 journal/models/shelf.py:306 #: journal/templates/_sidebar_user_mark_list.html:26 msgid "review" msgstr "" @@ -1451,17 +1451,17 @@ msgstr "" msgid "all seasons" msgstr "" -#: catalog/templates/tvseason.html:32 catalog/tv/models.py:273 +#: catalog/templates/tvseason.html:32 catalog/tv/models.py:274 msgid "season number" msgstr "" #: catalog/templates/tvseason.html:37 catalog/templates/tvshow.html:32 -#: catalog/tv/models.py:106 +#: catalog/tv/models.py:107 msgid "number of seasons" msgstr "" #: catalog/templates/tvseason.html:42 catalog/templates/tvshow.html:37 -#: catalog/tv/models.py:109 catalog/tv/models.py:276 +#: catalog/tv/models.py:110 catalog/tv/models.py:277 msgid "number of episodes" msgstr "" @@ -1469,28 +1469,28 @@ msgstr "" msgid "Editions" msgstr "" -#: catalog/tv/models.py:172 catalog/tv/models.py:339 +#: catalog/tv/models.py:173 catalog/tv/models.py:340 msgid "show time" msgstr "" -#: catalog/tv/models.py:184 +#: catalog/tv/models.py:185 msgid "Date" msgstr "" -#: catalog/tv/models.py:189 +#: catalog/tv/models.py:190 msgid "Region or Event" msgstr "" -#: catalog/tv/models.py:215 catalog/tv/models.py:393 +#: catalog/tv/models.py:216 catalog/tv/models.py:394 msgid "episode length" msgstr "" -#: catalog/tv/models.py:424 +#: catalog/tv/models.py:426 #, python-brace-format msgid "{show_title} Season {season_number}" msgstr "" -#: catalog/tv/models.py:495 +#: catalog/tv/models.py:501 #, python-brace-format msgid "{season_title} E{episode_number}" msgstr "" @@ -2587,8 +2587,9 @@ msgstr "" #: journal/forms.py:25 journal/forms.py:45 #: journal/templates/collection_share.html:24 -#: journal/templates/wrapped_share.html:36 users/templates/users/data.html:39 -#: users/templates/users/data.html:140 +#: journal/templates/wrapped_share.html:36 users/templates/users/data.html:46 +#: users/templates/users/data.html:138 users/templates/users/data.html:191 +#: users/templates/users/data.html:250 msgid "Visibility" msgstr "" @@ -2604,12 +2605,12 @@ msgstr "" msgid "Collaborative editing" msgstr "" -#: journal/importers/letterboxd.py:110 +#: journal/importers/letterboxd.py:119 #, python-brace-format msgid "a review of {item_title}" msgstr "" -#: journal/importers/opml.py:36 +#: journal/importers/opml.py:45 #, python-brace-format msgid "{username}'s podcast subscriptions" msgstr "" @@ -2630,8 +2631,9 @@ msgstr "" #: journal/templates/action_open_post.html:16 #: journal/templates/collection_share.html:35 journal/templates/comment.html:35 #: journal/templates/mark.html:88 journal/templates/tag_edit.html:42 -#: journal/templates/wrapped_share.html:43 users/templates/users/data.html:48 -#: users/templates/users/data.html:149 +#: journal/templates/wrapped_share.html:43 users/templates/users/data.html:55 +#: users/templates/users/data.html:147 users/templates/users/data.html:199 +#: users/templates/users/data.html:259 #: users/templates/users/preferences.html:56 msgid "Public" msgstr "" @@ -2639,7 +2641,8 @@ msgstr "" #: journal/models/common.py:40 journal/templates/action_open_post.html:10 #: journal/templates/collection_share.html:46 journal/templates/comment.html:42 #: journal/templates/mark.html:95 journal/templates/wrapped_share.html:49 -#: users/templates/users/data.html:56 users/templates/users/data.html:157 +#: users/templates/users/data.html:63 users/templates/users/data.html:155 +#: users/templates/users/data.html:207 users/templates/users/data.html:267 #: users/templates/users/preferences.html:63 msgid "Followers Only" msgstr "" @@ -2647,7 +2650,8 @@ msgstr "" #: journal/models/common.py:41 journal/templates/action_open_post.html:12 #: journal/templates/collection_share.html:57 journal/templates/comment.html:49 #: journal/templates/mark.html:102 journal/templates/wrapped_share.html:55 -#: users/templates/users/data.html:64 users/templates/users/data.html:165 +#: users/templates/users/data.html:71 users/templates/users/data.html:163 +#: users/templates/users/data.html:215 users/templates/users/data.html:275 #: users/templates/users/preferences.html:70 msgid "Mentioned Only" msgstr "" @@ -2730,419 +2734,419 @@ msgstr "" msgid "Cycle {value}" msgstr "" -#: journal/models/renderers.py:104 +#: journal/models/renderers.py:108 #, python-brace-format msgid "regarding {item_title}, may contain spoiler or triggering content" msgstr "" -#: journal/models/shelf.py:26 +#: journal/models/shelf.py:27 msgid "WISHLIST" msgstr "" -#: journal/models/shelf.py:27 +#: journal/models/shelf.py:28 msgid "PROGRESS" msgstr "" -#: journal/models/shelf.py:28 +#: journal/models/shelf.py:29 msgid "COMPLETE" msgstr "" -#: journal/models/shelf.py:29 +#: journal/models/shelf.py:30 msgid "DROPPED" msgstr "" -#: journal/models/shelf.py:38 +#: journal/models/shelf.py:39 msgid "books to read" msgstr "" -#: journal/models/shelf.py:39 +#: journal/models/shelf.py:40 msgid "want to read" msgstr "" -#: journal/models/shelf.py:40 +#: journal/models/shelf.py:41 #, python-brace-format msgid "wants to read {item}" msgstr "" -#: journal/models/shelf.py:41 +#: journal/models/shelf.py:42 msgid "to read" msgstr "" -#: journal/models/shelf.py:46 +#: journal/models/shelf.py:47 msgid "books reading" msgstr "" -#: journal/models/shelf.py:47 +#: journal/models/shelf.py:48 msgid "start reading" msgstr "" -#: journal/models/shelf.py:48 +#: journal/models/shelf.py:49 #, python-brace-format msgid "started reading {item}" msgstr "" -#: journal/models/shelf.py:49 +#: journal/models/shelf.py:50 msgid "reading" msgstr "" -#: journal/models/shelf.py:54 +#: journal/models/shelf.py:55 msgid "books completed" msgstr "" -#: journal/models/shelf.py:55 +#: journal/models/shelf.py:56 msgid "finish reading" msgstr "" -#: journal/models/shelf.py:56 +#: journal/models/shelf.py:57 #, python-brace-format msgid "finished reading {item}" msgstr "" -#: journal/models/shelf.py:57 +#: journal/models/shelf.py:58 msgid "read" msgstr "" -#: journal/models/shelf.py:62 +#: journal/models/shelf.py:63 msgid "books dropped" msgstr "" -#: journal/models/shelf.py:63 +#: journal/models/shelf.py:64 msgid "stop reading" msgstr "" -#: journal/models/shelf.py:64 +#: journal/models/shelf.py:65 #, python-brace-format msgid "stopped reading {item}" msgstr "" -#: journal/models/shelf.py:65 +#: journal/models/shelf.py:66 msgid "stopped reading" msgstr "" -#: journal/models/shelf.py:70 +#: journal/models/shelf.py:71 msgid "books reviewed" msgstr "" -#: journal/models/shelf.py:72 journal/models/shelf.py:112 -#: journal/models/shelf.py:152 journal/models/shelf.py:192 -#: journal/models/shelf.py:232 journal/models/shelf.py:272 -#: journal/models/shelf.py:306 +#: journal/models/shelf.py:73 journal/models/shelf.py:113 +#: journal/models/shelf.py:153 journal/models/shelf.py:193 +#: journal/models/shelf.py:233 journal/models/shelf.py:273 +#: journal/models/shelf.py:307 #, python-brace-format msgid "wrote a review of {item}" msgstr "" -#: journal/models/shelf.py:78 +#: journal/models/shelf.py:79 msgid "movies to watch" msgstr "" -#: journal/models/shelf.py:79 journal/models/shelf.py:119 +#: journal/models/shelf.py:80 journal/models/shelf.py:120 msgid "want to watch" msgstr "" -#: journal/models/shelf.py:80 journal/models/shelf.py:120 +#: journal/models/shelf.py:81 journal/models/shelf.py:121 #, python-brace-format msgid "wants to watch {item}" msgstr "" -#: journal/models/shelf.py:81 journal/models/shelf.py:121 +#: journal/models/shelf.py:82 journal/models/shelf.py:122 msgid "to watch" msgstr "" -#: journal/models/shelf.py:86 +#: journal/models/shelf.py:87 msgid "movies watching" msgstr "" -#: journal/models/shelf.py:87 journal/models/shelf.py:127 +#: journal/models/shelf.py:88 journal/models/shelf.py:128 msgid "start watching" msgstr "" -#: journal/models/shelf.py:88 journal/models/shelf.py:128 +#: journal/models/shelf.py:89 journal/models/shelf.py:129 #, python-brace-format msgid "started watching {item}" msgstr "" -#: journal/models/shelf.py:89 journal/models/shelf.py:129 +#: journal/models/shelf.py:90 journal/models/shelf.py:130 msgid "watching" msgstr "" -#: journal/models/shelf.py:94 +#: journal/models/shelf.py:95 msgid "movies watched" msgstr "" -#: journal/models/shelf.py:95 journal/models/shelf.py:135 +#: journal/models/shelf.py:96 journal/models/shelf.py:136 msgid "finish watching" msgstr "" -#: journal/models/shelf.py:96 journal/models/shelf.py:136 +#: journal/models/shelf.py:97 journal/models/shelf.py:137 #, python-brace-format msgid "finished watching {item}" msgstr "" -#: journal/models/shelf.py:97 journal/models/shelf.py:137 +#: journal/models/shelf.py:98 journal/models/shelf.py:138 msgid "watched" msgstr "" -#: journal/models/shelf.py:102 +#: journal/models/shelf.py:103 msgid "movies dropped" msgstr "" -#: journal/models/shelf.py:103 journal/models/shelf.py:143 +#: journal/models/shelf.py:104 journal/models/shelf.py:144 msgid "stop watching" msgstr "" -#: journal/models/shelf.py:104 journal/models/shelf.py:144 +#: journal/models/shelf.py:105 journal/models/shelf.py:145 #, python-brace-format msgid "stopped watching {item}" msgstr "" -#: journal/models/shelf.py:105 journal/models/shelf.py:145 +#: journal/models/shelf.py:106 journal/models/shelf.py:146 msgid "stopped watching" msgstr "" -#: journal/models/shelf.py:110 +#: journal/models/shelf.py:111 msgid "movies reviewed" msgstr "" -#: journal/models/shelf.py:118 +#: journal/models/shelf.py:119 msgid "TV shows to watch" msgstr "" -#: journal/models/shelf.py:126 +#: journal/models/shelf.py:127 msgid "TV shows watching" msgstr "" -#: journal/models/shelf.py:134 +#: journal/models/shelf.py:135 msgid "TV shows watched" msgstr "" -#: journal/models/shelf.py:142 +#: journal/models/shelf.py:143 msgid "TV shows dropped" msgstr "" -#: journal/models/shelf.py:150 +#: journal/models/shelf.py:151 msgid "TV shows reviewed" msgstr "" -#: journal/models/shelf.py:158 +#: journal/models/shelf.py:159 msgid "albums to listen" msgstr "" -#: journal/models/shelf.py:159 journal/models/shelf.py:239 +#: journal/models/shelf.py:160 journal/models/shelf.py:240 msgid "want to listen" msgstr "" -#: journal/models/shelf.py:160 journal/models/shelf.py:240 +#: journal/models/shelf.py:161 journal/models/shelf.py:241 #, python-brace-format msgid "wants to listen {item}" msgstr "" -#: journal/models/shelf.py:161 journal/models/shelf.py:241 +#: journal/models/shelf.py:162 journal/models/shelf.py:242 msgid "to listen" msgstr "" -#: journal/models/shelf.py:166 +#: journal/models/shelf.py:167 msgid "albums listening" msgstr "" -#: journal/models/shelf.py:167 journal/models/shelf.py:247 +#: journal/models/shelf.py:168 journal/models/shelf.py:248 msgid "start listening" msgstr "" -#: journal/models/shelf.py:168 journal/models/shelf.py:248 +#: journal/models/shelf.py:169 journal/models/shelf.py:249 #, python-brace-format msgid "started listening {item}" msgstr "" -#: journal/models/shelf.py:169 journal/models/shelf.py:249 +#: journal/models/shelf.py:170 journal/models/shelf.py:250 msgid "listening" msgstr "" -#: journal/models/shelf.py:174 +#: journal/models/shelf.py:175 msgid "albums listened" msgstr "" -#: journal/models/shelf.py:175 journal/models/shelf.py:255 +#: journal/models/shelf.py:176 journal/models/shelf.py:256 msgid "finish listening" msgstr "" -#: journal/models/shelf.py:176 journal/models/shelf.py:256 +#: journal/models/shelf.py:177 journal/models/shelf.py:257 #, python-brace-format msgid "finished listening {item}" msgstr "" -#: journal/models/shelf.py:177 journal/models/shelf.py:257 +#: journal/models/shelf.py:178 journal/models/shelf.py:258 msgid "listened" msgstr "" -#: journal/models/shelf.py:182 +#: journal/models/shelf.py:183 msgid "albums dropped" msgstr "" -#: journal/models/shelf.py:183 journal/models/shelf.py:263 +#: journal/models/shelf.py:184 journal/models/shelf.py:264 msgid "stop listening" msgstr "" -#: journal/models/shelf.py:184 journal/models/shelf.py:264 +#: journal/models/shelf.py:185 journal/models/shelf.py:265 #, python-brace-format msgid "stopped listening {item}" msgstr "" -#: journal/models/shelf.py:185 journal/models/shelf.py:265 +#: journal/models/shelf.py:186 journal/models/shelf.py:266 msgid "stopped listening" msgstr "" -#: journal/models/shelf.py:190 +#: journal/models/shelf.py:191 msgid "albums reviewed" msgstr "" -#: journal/models/shelf.py:198 +#: journal/models/shelf.py:199 msgid "games to play" msgstr "" -#: journal/models/shelf.py:199 +#: journal/models/shelf.py:200 msgid "want to play" msgstr "" -#: journal/models/shelf.py:200 +#: journal/models/shelf.py:201 #, python-brace-format msgid "wants to play {item}" msgstr "" -#: journal/models/shelf.py:201 +#: journal/models/shelf.py:202 msgid "to play" msgstr "" -#: journal/models/shelf.py:206 +#: journal/models/shelf.py:207 msgid "games playing" msgstr "" -#: journal/models/shelf.py:207 +#: journal/models/shelf.py:208 msgid "start playing" msgstr "" -#: journal/models/shelf.py:208 +#: journal/models/shelf.py:209 #, python-brace-format msgid "started playing {item}" msgstr "" -#: journal/models/shelf.py:209 +#: journal/models/shelf.py:210 msgid "playing" msgstr "" -#: journal/models/shelf.py:214 +#: journal/models/shelf.py:215 msgid "games played" msgstr "" -#: journal/models/shelf.py:215 +#: journal/models/shelf.py:216 msgid "finish playing" msgstr "" -#: journal/models/shelf.py:216 +#: journal/models/shelf.py:217 #, python-brace-format msgid "finished playing {item}" msgstr "" -#: journal/models/shelf.py:217 +#: journal/models/shelf.py:218 msgid "played" msgstr "" -#: journal/models/shelf.py:222 +#: journal/models/shelf.py:223 msgid "games dropped" msgstr "" -#: journal/models/shelf.py:223 +#: journal/models/shelf.py:224 msgid "stop playing" msgstr "" -#: journal/models/shelf.py:224 +#: journal/models/shelf.py:225 #, python-brace-format msgid "stopped playing {item}" msgstr "" -#: journal/models/shelf.py:225 +#: journal/models/shelf.py:226 msgid "stopped playing" msgstr "" -#: journal/models/shelf.py:230 +#: journal/models/shelf.py:231 msgid "games reviewed" msgstr "" -#: journal/models/shelf.py:238 +#: journal/models/shelf.py:239 msgid "podcasts to listen" msgstr "" -#: journal/models/shelf.py:246 +#: journal/models/shelf.py:247 msgid "podcasts listening" msgstr "" -#: journal/models/shelf.py:254 +#: journal/models/shelf.py:255 msgid "podcasts listened" msgstr "" -#: journal/models/shelf.py:262 +#: journal/models/shelf.py:263 msgid "podcasts dropped" msgstr "" -#: journal/models/shelf.py:270 +#: journal/models/shelf.py:271 msgid "podcasts reviewed" msgstr "" -#: journal/models/shelf.py:278 +#: journal/models/shelf.py:279 msgid "performances to see" msgstr "" -#: journal/models/shelf.py:279 +#: journal/models/shelf.py:280 msgid "want to see" msgstr "" -#: journal/models/shelf.py:280 +#: journal/models/shelf.py:281 #, python-brace-format msgid "wants to see {item}" msgstr "" -#: journal/models/shelf.py:281 +#: journal/models/shelf.py:282 msgid "to see" msgstr "" -#: journal/models/shelf.py:288 +#: journal/models/shelf.py:289 msgid "performances saw" msgstr "" -#: journal/models/shelf.py:289 +#: journal/models/shelf.py:290 msgid "finish seeing" msgstr "" -#: journal/models/shelf.py:290 +#: journal/models/shelf.py:291 #, python-brace-format msgid "finished seeing {item}" msgstr "" -#: journal/models/shelf.py:291 +#: journal/models/shelf.py:292 msgid "seen" msgstr "" -#: journal/models/shelf.py:296 +#: journal/models/shelf.py:297 msgid "performances dropped" msgstr "" -#: journal/models/shelf.py:297 +#: journal/models/shelf.py:298 msgid "stop seeing" msgstr "" -#: journal/models/shelf.py:298 +#: journal/models/shelf.py:299 #, python-brace-format msgid "stopped seeing {item}" msgstr "" -#: journal/models/shelf.py:299 +#: journal/models/shelf.py:300 msgid "stopped seeing" msgstr "" -#: journal/models/shelf.py:304 +#: journal/models/shelf.py:305 msgid "performances reviewed" msgstr "" -#: journal/models/shelf.py:566 +#: journal/models/shelf.py:609 msgid "removed mark" msgstr "" @@ -3182,46 +3186,58 @@ msgstr "" msgid "Update note" msgstr "" -#: journal/templates/_sidebar_search_journal.html:4 -msgid "Addtional filters may be added to query" +#: journal/templates/_sidebar_search_journal.html:5 +msgid "Search filters" msgstr "" -#: journal/templates/_sidebar_search_journal.html:6 +#: journal/templates/_sidebar_search_journal.html:8 msgid "filter by one of these statuses" msgstr "" -#: journal/templates/_sidebar_search_journal.html:9 +#: journal/templates/_sidebar_search_journal.html:11 msgid "filter by rating range" msgstr "" -#: journal/templates/_sidebar_search_journal.html:12 +#: journal/templates/_sidebar_search_journal.html:14 msgid "filter unrated" msgstr "" -#: journal/templates/_sidebar_search_journal.html:15 +#: journal/templates/_sidebar_search_journal.html:17 msgid "filter by tag" msgstr "" -#: journal/templates/_sidebar_search_journal.html:18 +#: journal/templates/_sidebar_search_journal.html:20 msgid "filter by one of these categories" msgstr "" -#: journal/templates/_sidebar_search_journal.html:21 +#: journal/templates/_sidebar_search_journal.html:23 msgid "filter by one of these types" msgstr "" -#: journal/templates/_sidebar_search_journal.html:24 +#: journal/templates/_sidebar_search_journal.html:26 msgid "filter by date" msgstr "" -#: journal/templates/_sidebar_search_journal.html:27 +#: journal/templates/_sidebar_search_journal.html:29 msgid "filter by month" msgstr "" -#: journal/templates/_sidebar_search_journal.html:30 +#: journal/templates/_sidebar_search_journal.html:32 msgid "filter by date range" msgstr "" +#: journal/templates/_sidebar_search_journal.html:35 +msgid "sort by one of these fields" +msgstr "" + +#: journal/templates/_sidebar_search_journal.html:35 +msgid "from new to old" +msgstr "" + +#: journal/templates/_sidebar_search_journal.html:35 +msgid "from high to low" +msgstr "" + #: journal/templates/_sidebar_user_mark_list.html:61 msgid "sorting" msgstr "" @@ -3685,6 +3701,10 @@ msgstr "" msgid "{review_title} - a review of {item_title}" msgstr "" +#: journal/views/review.py:142 +msgid "may contain spoiler or triggering content" +msgstr "" + #: journal/views/tag.py:41 journal/views/tag.py:55 msgid "Invalid tag" msgstr "" @@ -4402,129 +4422,149 @@ msgstr "" msgid "Data Management" msgstr "" -#: users/templates/users/data.html:20 +#: users/templates/users/data.html:27 msgid "Import Marks and Reviews from Douban" msgstr "" -#: users/templates/users/data.html:25 +#: users/templates/users/data.html:32 msgid "Select .xlsx exported from Doufen" msgstr "" -#: users/templates/users/data.html:28 users/templates/users/data.html:195 +#: users/templates/users/data.html:35 users/templates/users/data.html:178 msgid "Import Method" msgstr "" -#: users/templates/users/data.html:31 +#: users/templates/users/data.html:38 msgid "Merge: only update when status changes from wishlist to in-progress, or from in-progress to complete." msgstr "" -#: users/templates/users/data.html:35 +#: users/templates/users/data.html:42 msgid "Overwrite: update all imported status." msgstr "" -#: users/templates/users/data.html:68 +#: users/templates/users/data.html:75 msgid "Another import is in progress, starting a new import may cause issues, sure to import?" msgstr "" -#: users/templates/users/data.html:68 +#: users/templates/users/data.html:75 msgid "Import in progress, please wait" msgstr "" -#: users/templates/users/data.html:68 users/templates/users/data.html:87 -#: users/templates/users/data.html:168 users/templates/users/data.html:211 +#: users/templates/users/data.html:75 users/templates/users/data.html:111 +#: users/templates/users/data.html:166 users/templates/users/data.html:220 +#: users/templates/users/data.html:280 msgid "Import" msgstr "" -#: users/templates/users/data.html:77 +#: users/templates/users/data.html:81 msgid "Import Shelf or List from Goodreads" msgstr "" -#: users/templates/users/data.html:81 +#: users/templates/users/data.html:85 msgid "Link to Goodreads Profile / Shelf / List" msgstr "" -#: users/templates/users/data.html:91 users/templates/users/data.html:173 -#: users/templates/users/data_import_status.html:2 -msgid "Last import started" +#: users/templates/users/data.html:90 +msgid "want-to-read / currently-reading / read books and their reviews will be imported." msgstr "" -#: users/templates/users/data.html:92 users/templates/users/data.html:174 -#: users/templates/users/data.html:228 users/templates/users/data.html:246 -#: users/templates/users/data.html:263 +#: users/templates/users/data.html:95 +msgid "Shelf will be imported as a new collection." +msgstr "" + +#: users/templates/users/data.html:100 +msgid "List will be imported as a new collection." +msgstr "" + +#: users/templates/users/data.html:119 +msgid "Import from Letterboxd" +msgstr "" + +#: users/templates/users/data.html:167 +msgid "Only forward changes(none->to-watch->watched) will be imported." +msgstr "" + +#: users/templates/users/data.html:174 +msgid "Import Podcast Subscriptions" +msgstr "" + +#: users/templates/users/data.html:185 +msgid "Mark as listening" +msgstr "" + +#: users/templates/users/data.html:189 +msgid "Import as a new collection" +msgstr "" + +#: users/templates/users/data.html:218 +msgid "Select OPML file" +msgstr "" + +#: users/templates/users/data.html:228 +msgid "Import NeoDB Archive" +msgstr "" + +#: users/templates/users/data.html:234 +msgid "Upload a .zip file containing .csv or .ndjson files exported from NeoDB." +msgstr "" + +#: users/templates/users/data.html:236 +msgid "Existing data may be overwritten." +msgstr "" + +#: users/templates/users/data.html:246 +msgid "Detected format" +msgstr "" + +#: users/templates/users/data.html:307 +msgid "Detecting format..." +msgstr "" + +#: users/templates/users/data.html:333 +msgid "Unknown format" +msgstr "" + +#: users/templates/users/data.html:358 +msgid "Error detecting format" +msgstr "" + +#: users/templates/users/data.html:382 +msgid "Export NeoDB Archive" +msgstr "" + +#: users/templates/users/data.html:386 +msgid "Export marks, reviews and notes in CSV" +msgstr "" + +#: users/templates/users/data.html:393 +msgid "Export everything in NDJSON" +msgstr "" + +#: users/templates/users/data.html:404 +msgid "Export marks and reviews in XLSX (Doufen format)" +msgstr "" + +#: users/templates/users/data.html:407 +msgid "Last export" +msgstr "" + +#: users/templates/users/data.html:408 #: users/templates/users/data_import_status.html:3 msgid "Status" msgstr "" -#: users/templates/users/data.html:101 -msgid "want-to-read / currently-reading / read books and their reviews will be imported." -msgstr "" - -#: users/templates/users/data.html:105 -msgid "Shelf will be imported as a new collection." -msgstr "" - -#: users/templates/users/data.html:109 -msgid "List will be imported as a new collection." -msgstr "" - -#: users/templates/users/data.html:120 -msgid "Import from Letterboxd" -msgstr "" - -#: users/templates/users/data.html:170 -msgid "Only forward changes(none->to-watch->watched) will be imported." -msgstr "" - -#: users/templates/users/data.html:178 -msgid "Failed links, likely due to Letterboxd error, you may have to mark them manually" -msgstr "" - -#: users/templates/users/data.html:189 -msgid "Import Podcast Subscriptions" -msgstr "" - -#: users/templates/users/data.html:202 -msgid "Mark as listening" -msgstr "" - -#: users/templates/users/data.html:206 -msgid "Import as a new collection" -msgstr "" - -#: users/templates/users/data.html:209 -msgid "Select OPML file" -msgstr "" - -#: users/templates/users/data.html:218 -msgid "Export Data" -msgstr "" - -#: users/templates/users/data.html:224 -msgid "Export marks and reviews in XLSX (Doufen format)" -msgstr "" - -#: users/templates/users/data.html:227 users/templates/users/data.html:245 -#: users/templates/users/data.html:262 -msgid "Last export" -msgstr "" - -#: users/templates/users/data.html:232 users/templates/users/data.html:250 -#: users/templates/users/data.html:267 +#: users/templates/users/data.html:412 msgid "Download" msgstr "" -#: users/templates/users/data.html:242 -msgid "Export marks, reviews and notes in CSV" -msgstr "" - -#: users/templates/users/data.html:259 -msgid "Export everything in NDJSON" -msgstr "" - -#: users/templates/users/data.html:275 +#: users/templates/users/data.html:420 msgid "View Annual Summary" msgstr "" +#: users/templates/users/data_import_status.html:2 +msgid "Last import started" +msgstr "" + #: users/templates/users/data_import_status.html:11 msgid "Failed links, you may have to mark them manually" msgstr "" @@ -4861,6 +4901,10 @@ msgstr "" msgid "You may download the list here." msgstr "" +#: users/templates/users/user_task_status.html:29 +msgid "Failed items" +msgstr "" + #: users/templates/users/verify.html:22 msgid "Please enter the verification code you received." msgstr "" @@ -4922,42 +4966,34 @@ msgstr "" msgid "Account mismatch." msgstr "" -#: users/views/data.py:131 users/views/data.py:168 users/views/data.py:200 -msgid "Generating exports." -msgstr "" - -#: users/views/data.py:137 users/views/data.py:174 users/views/data.py:206 +#: users/views/data.py:174 users/views/data.py:203 msgid "Export file not available." msgstr "" -#: users/views/data.py:149 +#: users/views/data.py:197 +msgid "Generating exports." +msgstr "" + +#: users/views/data.py:215 msgid "Export file expired. Please export again." msgstr "" -#: users/views/data.py:164 users/views/data.py:196 +#: users/views/data.py:230 users/views/data.py:250 msgid "Recent export still in progress." msgstr "" -#: users/views/data.py:222 +#: users/views/data.py:264 msgid "Sync in progress." msgstr "" -#: users/views/data.py:236 +#: users/views/data.py:278 msgid "Settings saved." msgstr "" -#: users/views/data.py:250 -msgid "Import in progress." -msgstr "" - -#: users/views/data.py:252 +#: users/views/data.py:288 msgid "Invalid URL." msgstr "" -#: users/views/data.py:270 users/views/data.py:320 +#: users/views/data.py:303 users/views/data.py:328 users/views/data.py:352 msgid "Invalid file." msgstr "" - -#: users/views/data.py:279 users/views/data.py:302 users/views/data.py:317 -msgid "File is uploaded and will be imported soon." -msgstr "" diff --git a/locale/zh_Hans/LC_MESSAGES/django.po b/locale/zh_Hans/LC_MESSAGES/django.po index b18d1b26..9be2cf38 100644 --- a/locale/zh_Hans/LC_MESSAGES/django.po +++ b/locale/zh_Hans/LC_MESSAGES/django.po @@ -5,12 +5,11 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: dev@neodb.social.NOSPAM\n" -"POT-Creation-Date: 2025-02-09 13:23-0500\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-03-10 02:19-0400\n" "PO-Revision-Date: 2025-03-01 01:20+0000\n" "Last-Translator: 猫猫 \n" -"Language-Team: Chinese (Simplified Han script) \n" +"Language-Team: Chinese (Simplified Han script) \n" "Language: zh_Hans\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -90,15 +89,15 @@ msgid "subtitle" msgstr "副标题" #: catalog/book/models.py:168 catalog/movie/models.py:65 -#: catalog/performance/models.py:256 catalog/tv/models.py:134 -#: catalog/tv/models.py:301 +#: catalog/performance/models.py:256 catalog/tv/models.py:135 +#: catalog/tv/models.py:302 msgid "original title" msgstr "原名" #: catalog/book/models.py:172 catalog/game/models.py:72 #: catalog/movie/models.py:68 catalog/music/models.py:88 #: catalog/performance/models.py:114 catalog/performance/models.py:259 -#: catalog/tv/models.py:138 catalog/tv/models.py:304 +#: catalog/tv/models.py:139 catalog/tv/models.py:305 msgid "other title" msgstr "其它标题" @@ -448,7 +447,7 @@ msgstr "播客" msgid "FanFic" msgstr "网文" -#: catalog/common/models.py:333 catalog/tv/models.py:381 +#: catalog/common/models.py:333 catalog/tv/models.py:382 #: users/models/user.py:113 msgid "language" msgstr "语言" @@ -560,7 +559,7 @@ msgid "date of publication" msgstr "发行日期" #: catalog/game/models.py:120 catalog/music/models.py:59 -#: catalog/tv/models.py:185 +#: catalog/tv/models.py:186 msgid "YYYY-MM-DD" msgstr "YYYY-MM-DD" @@ -570,7 +569,7 @@ msgstr "发布类型" #: catalog/game/models.py:131 catalog/movie/models.py:96 #: catalog/performance/models.py:121 catalog/podcast/models.py:58 -#: catalog/tv/models.py:165 catalog/tv/models.py:332 +#: catalog/tv/models.py:166 catalog/tv/models.py:333 msgid "genre" msgstr "类型" @@ -584,26 +583,26 @@ msgstr "平台" #: catalog/templates/movie.html:58 catalog/templates/performance.html:33 #: catalog/templates/performanceproduction.html:33 #: catalog/templates/podcast.html:20 catalog/templates/tvseason.html:75 -#: catalog/templates/tvshow.html:70 catalog/tv/models.py:199 -#: catalog/tv/models.py:367 +#: catalog/templates/tvshow.html:70 catalog/tv/models.py:200 +#: catalog/tv/models.py:368 msgid "website" msgstr "网站" #: catalog/movie/models.py:75 catalog/performance/models.py:129 -#: catalog/performance/models.py:267 catalog/tv/models.py:144 -#: catalog/tv/models.py:311 +#: catalog/performance/models.py:267 catalog/tv/models.py:145 +#: catalog/tv/models.py:312 msgid "director" msgstr "导演" #: catalog/movie/models.py:82 catalog/performance/models.py:136 -#: catalog/performance/models.py:274 catalog/tv/models.py:151 -#: catalog/tv/models.py:318 +#: catalog/performance/models.py:274 catalog/tv/models.py:152 +#: catalog/tv/models.py:319 msgid "playwright" msgstr "编剧" #: catalog/movie/models.py:89 catalog/performance/models.py:164 -#: catalog/performance/models.py:302 catalog/tv/models.py:158 -#: catalog/tv/models.py:325 +#: catalog/performance/models.py:302 catalog/tv/models.py:159 +#: catalog/tv/models.py:326 msgid "actor" msgstr "演员" @@ -615,32 +614,32 @@ msgstr "演员" msgid "release date" msgstr "发布日期" -#: catalog/movie/models.py:115 catalog/tv/models.py:351 +#: catalog/movie/models.py:115 catalog/tv/models.py:352 #: journal/templates/_sidebar_user_mark_list.html:62 msgid "date" msgstr "日期" #: catalog/movie/models.py:116 catalog/performance/models.py:81 -#: catalog/tv/models.py:352 +#: catalog/tv/models.py:353 msgid "required" msgstr "必填" -#: catalog/movie/models.py:120 catalog/tv/models.py:356 +#: catalog/movie/models.py:120 catalog/tv/models.py:357 msgid "region or event" msgstr "地区或类型" -#: catalog/movie/models.py:122 catalog/tv/models.py:191 -#: catalog/tv/models.py:358 +#: catalog/movie/models.py:122 catalog/tv/models.py:192 +#: catalog/tv/models.py:359 msgid "Germany or Toronto International Film Festival" msgstr "德国或多伦多国际电影节" -#: catalog/movie/models.py:132 catalog/tv/models.py:201 -#: catalog/tv/models.py:370 +#: catalog/movie/models.py:132 catalog/tv/models.py:202 +#: catalog/tv/models.py:371 msgid "region" msgstr "地区" -#: catalog/movie/models.py:143 catalog/tv/models.py:213 -#: catalog/tv/models.py:391 +#: catalog/movie/models.py:143 catalog/tv/models.py:214 +#: catalog/tv/models.py:392 msgid "year" msgstr "年份" @@ -797,10 +796,10 @@ msgstr "没有更多内容了。" msgid "comment this episode" msgstr "写该集短评" -#: catalog/templates/_item_reviews.html:26 journal/models/shelf.py:71 -#: journal/models/shelf.py:111 journal/models/shelf.py:151 -#: journal/models/shelf.py:191 journal/models/shelf.py:231 -#: journal/models/shelf.py:271 journal/models/shelf.py:305 +#: catalog/templates/_item_reviews.html:26 journal/models/shelf.py:72 +#: journal/models/shelf.py:112 journal/models/shelf.py:152 +#: journal/models/shelf.py:192 journal/models/shelf.py:232 +#: journal/models/shelf.py:272 journal/models/shelf.py:306 #: journal/templates/_sidebar_user_mark_list.html:26 msgid "review" msgstr "评论" @@ -1451,17 +1450,17 @@ msgstr "登录用户可看到来自其它网站的搜索结果。" msgid "all seasons" msgstr "本剧所有季" -#: catalog/templates/tvseason.html:32 catalog/tv/models.py:273 +#: catalog/templates/tvseason.html:32 catalog/tv/models.py:274 msgid "season number" msgstr "本季序号" #: catalog/templates/tvseason.html:37 catalog/templates/tvshow.html:32 -#: catalog/tv/models.py:106 +#: catalog/tv/models.py:107 msgid "number of seasons" msgstr "季数" #: catalog/templates/tvseason.html:42 catalog/templates/tvshow.html:37 -#: catalog/tv/models.py:109 catalog/tv/models.py:276 +#: catalog/tv/models.py:110 catalog/tv/models.py:277 msgid "number of episodes" msgstr "集数" @@ -1469,28 +1468,28 @@ msgstr "集数" msgid "Editions" msgstr "版本" -#: catalog/tv/models.py:172 catalog/tv/models.py:339 +#: catalog/tv/models.py:173 catalog/tv/models.py:340 msgid "show time" msgstr "上映时间" -#: catalog/tv/models.py:184 +#: catalog/tv/models.py:185 msgid "Date" msgstr "日期" -#: catalog/tv/models.py:189 +#: catalog/tv/models.py:190 msgid "Region or Event" msgstr "地区或场合" -#: catalog/tv/models.py:215 catalog/tv/models.py:393 +#: catalog/tv/models.py:216 catalog/tv/models.py:394 msgid "episode length" msgstr "单集长度" -#: catalog/tv/models.py:424 +#: catalog/tv/models.py:426 #, python-brace-format msgid "{show_title} Season {season_number}" msgstr "{show_title} 第{season_number}季" -#: catalog/tv/models.py:495 +#: catalog/tv/models.py:501 #, python-brace-format msgid "{season_title} E{episode_number}" msgstr "{season_title} 第{episode_number}集" @@ -2605,8 +2604,9 @@ msgstr "转发到时间轴" #: journal/forms.py:25 journal/forms.py:45 #: journal/templates/collection_share.html:24 -#: journal/templates/wrapped_share.html:36 users/templates/users/data.html:39 -#: users/templates/users/data.html:140 +#: journal/templates/wrapped_share.html:36 users/templates/users/data.html:46 +#: users/templates/users/data.html:138 users/templates/users/data.html:191 +#: users/templates/users/data.html:250 msgid "Visibility" msgstr "可见性" @@ -2622,12 +2622,12 @@ msgstr "创建者和他们的互相关注" msgid "Collaborative editing" msgstr "协作编辑" -#: journal/importers/letterboxd.py:110 +#: journal/importers/letterboxd.py:119 #, python-brace-format msgid "a review of {item_title}" msgstr "关于 {item_title} 的评论" -#: journal/importers/opml.py:36 +#: journal/importers/opml.py:45 #, python-brace-format msgid "{username}'s podcast subscriptions" msgstr "{username} 的播客订阅" @@ -2648,8 +2648,9 @@ msgstr "创建了收藏单" #: journal/templates/action_open_post.html:16 #: journal/templates/collection_share.html:35 journal/templates/comment.html:35 #: journal/templates/mark.html:88 journal/templates/tag_edit.html:42 -#: journal/templates/wrapped_share.html:43 users/templates/users/data.html:48 -#: users/templates/users/data.html:149 +#: journal/templates/wrapped_share.html:43 users/templates/users/data.html:55 +#: users/templates/users/data.html:147 users/templates/users/data.html:199 +#: users/templates/users/data.html:259 #: users/templates/users/preferences.html:56 msgid "Public" msgstr "公开" @@ -2657,7 +2658,8 @@ msgstr "公开" #: journal/models/common.py:40 journal/templates/action_open_post.html:10 #: journal/templates/collection_share.html:46 journal/templates/comment.html:42 #: journal/templates/mark.html:95 journal/templates/wrapped_share.html:49 -#: users/templates/users/data.html:56 users/templates/users/data.html:157 +#: users/templates/users/data.html:63 users/templates/users/data.html:155 +#: users/templates/users/data.html:207 users/templates/users/data.html:267 #: users/templates/users/preferences.html:63 msgid "Followers Only" msgstr "仅关注者" @@ -2665,7 +2667,8 @@ msgstr "仅关注者" #: journal/models/common.py:41 journal/templates/action_open_post.html:12 #: journal/templates/collection_share.html:57 journal/templates/comment.html:49 #: journal/templates/mark.html:102 journal/templates/wrapped_share.html:55 -#: users/templates/users/data.html:64 users/templates/users/data.html:165 +#: users/templates/users/data.html:71 users/templates/users/data.html:163 +#: users/templates/users/data.html:215 users/templates/users/data.html:275 #: users/templates/users/preferences.html:70 msgid "Mentioned Only" msgstr "自己和提到的人" @@ -2748,419 +2751,419 @@ msgstr "第{value}首" msgid "Cycle {value}" msgstr "{value}周目" -#: journal/models/renderers.py:104 +#: journal/models/renderers.py:108 #, python-brace-format msgid "regarding {item_title}, may contain spoiler or triggering content" msgstr "关于 {item_title},可能包含剧透或敏感内容" -#: journal/models/shelf.py:26 +#: journal/models/shelf.py:27 msgid "WISHLIST" msgstr "WISHLIST" -#: journal/models/shelf.py:27 +#: journal/models/shelf.py:28 msgid "PROGRESS" msgstr "PROGRESS" -#: journal/models/shelf.py:28 +#: journal/models/shelf.py:29 msgid "COMPLETE" msgstr "COMPLETE" -#: journal/models/shelf.py:29 +#: journal/models/shelf.py:30 msgid "DROPPED" msgstr "DROPPED" -#: journal/models/shelf.py:38 +#: journal/models/shelf.py:39 msgid "books to read" msgstr "想读的书" -#: journal/models/shelf.py:39 +#: journal/models/shelf.py:40 msgid "want to read" msgstr "想读" -#: journal/models/shelf.py:40 +#: journal/models/shelf.py:41 #, python-brace-format msgid "wants to read {item}" msgstr "想读 {item}" -#: journal/models/shelf.py:41 +#: journal/models/shelf.py:42 msgid "to read" msgstr "想读" -#: journal/models/shelf.py:46 +#: journal/models/shelf.py:47 msgid "books reading" msgstr "正在读的书" -#: journal/models/shelf.py:47 +#: journal/models/shelf.py:48 msgid "start reading" msgstr "在读" -#: journal/models/shelf.py:48 +#: journal/models/shelf.py:49 #, python-brace-format msgid "started reading {item}" msgstr "在读 {item}" -#: journal/models/shelf.py:49 +#: journal/models/shelf.py:50 msgid "reading" msgstr "在读" -#: journal/models/shelf.py:54 +#: journal/models/shelf.py:55 msgid "books completed" msgstr "读过的书" -#: journal/models/shelf.py:55 +#: journal/models/shelf.py:56 msgid "finish reading" msgstr "读过" -#: journal/models/shelf.py:56 +#: journal/models/shelf.py:57 #, python-brace-format msgid "finished reading {item}" msgstr "读过 {item}" -#: journal/models/shelf.py:57 +#: journal/models/shelf.py:58 msgid "read" msgstr "已读" -#: journal/models/shelf.py:62 +#: journal/models/shelf.py:63 msgid "books dropped" msgstr "不再读的书" -#: journal/models/shelf.py:63 +#: journal/models/shelf.py:64 msgid "stop reading" msgstr "不读了" -#: journal/models/shelf.py:64 +#: journal/models/shelf.py:65 #, python-brace-format msgid "stopped reading {item}" msgstr "不再读 {item}" -#: journal/models/shelf.py:65 +#: journal/models/shelf.py:66 msgid "stopped reading" msgstr "不读了" -#: journal/models/shelf.py:70 +#: journal/models/shelf.py:71 msgid "books reviewed" msgstr "评论过的书" -#: journal/models/shelf.py:72 journal/models/shelf.py:112 -#: journal/models/shelf.py:152 journal/models/shelf.py:192 -#: journal/models/shelf.py:232 journal/models/shelf.py:272 -#: journal/models/shelf.py:306 +#: journal/models/shelf.py:73 journal/models/shelf.py:113 +#: journal/models/shelf.py:153 journal/models/shelf.py:193 +#: journal/models/shelf.py:233 journal/models/shelf.py:273 +#: journal/models/shelf.py:307 #, python-brace-format msgid "wrote a review of {item}" msgstr "写了关于 {item} 的评论" -#: journal/models/shelf.py:78 +#: journal/models/shelf.py:79 msgid "movies to watch" msgstr "想看的电影" -#: journal/models/shelf.py:79 journal/models/shelf.py:119 +#: journal/models/shelf.py:80 journal/models/shelf.py:120 msgid "want to watch" msgstr "想看" -#: journal/models/shelf.py:80 journal/models/shelf.py:120 +#: journal/models/shelf.py:81 journal/models/shelf.py:121 #, python-brace-format msgid "wants to watch {item}" msgstr "想看 {item}" -#: journal/models/shelf.py:81 journal/models/shelf.py:121 +#: journal/models/shelf.py:82 journal/models/shelf.py:122 msgid "to watch" msgstr "想看" -#: journal/models/shelf.py:86 +#: journal/models/shelf.py:87 msgid "movies watching" msgstr "正在看的电影" -#: journal/models/shelf.py:87 journal/models/shelf.py:127 +#: journal/models/shelf.py:88 journal/models/shelf.py:128 msgid "start watching" msgstr "在看" -#: journal/models/shelf.py:88 journal/models/shelf.py:128 +#: journal/models/shelf.py:89 journal/models/shelf.py:129 #, python-brace-format msgid "started watching {item}" msgstr "在看 {item}" -#: journal/models/shelf.py:89 journal/models/shelf.py:129 +#: journal/models/shelf.py:90 journal/models/shelf.py:130 msgid "watching" msgstr "在看" -#: journal/models/shelf.py:94 +#: journal/models/shelf.py:95 msgid "movies watched" msgstr "看过的电影" -#: journal/models/shelf.py:95 journal/models/shelf.py:135 +#: journal/models/shelf.py:96 journal/models/shelf.py:136 msgid "finish watching" msgstr "看过" -#: journal/models/shelf.py:96 journal/models/shelf.py:136 +#: journal/models/shelf.py:97 journal/models/shelf.py:137 #, python-brace-format msgid "finished watching {item}" msgstr "看过 {item}" -#: journal/models/shelf.py:97 journal/models/shelf.py:137 +#: journal/models/shelf.py:98 journal/models/shelf.py:138 msgid "watched" msgstr "看过" -#: journal/models/shelf.py:102 +#: journal/models/shelf.py:103 msgid "movies dropped" msgstr "不再看的电影" -#: journal/models/shelf.py:103 journal/models/shelf.py:143 +#: journal/models/shelf.py:104 journal/models/shelf.py:144 msgid "stop watching" msgstr "不看了" -#: journal/models/shelf.py:104 journal/models/shelf.py:144 +#: journal/models/shelf.py:105 journal/models/shelf.py:145 #, python-brace-format msgid "stopped watching {item}" msgstr "不再看 {item}" -#: journal/models/shelf.py:105 journal/models/shelf.py:145 +#: journal/models/shelf.py:106 journal/models/shelf.py:146 msgid "stopped watching" msgstr "不看了" -#: journal/models/shelf.py:110 +#: journal/models/shelf.py:111 msgid "movies reviewed" msgstr "评论过的电影" -#: journal/models/shelf.py:118 +#: journal/models/shelf.py:119 msgid "TV shows to watch" msgstr "想看的剧集" -#: journal/models/shelf.py:126 +#: journal/models/shelf.py:127 msgid "TV shows watching" msgstr "正在看的剧集" -#: journal/models/shelf.py:134 +#: journal/models/shelf.py:135 msgid "TV shows watched" msgstr "看过的剧集" -#: journal/models/shelf.py:142 +#: journal/models/shelf.py:143 msgid "TV shows dropped" msgstr "不再看的剧集" -#: journal/models/shelf.py:150 +#: journal/models/shelf.py:151 msgid "TV shows reviewed" msgstr "评论过的剧集" -#: journal/models/shelf.py:158 +#: journal/models/shelf.py:159 msgid "albums to listen" msgstr "想听的专辑" -#: journal/models/shelf.py:159 journal/models/shelf.py:239 +#: journal/models/shelf.py:160 journal/models/shelf.py:240 msgid "want to listen" msgstr "想听" -#: journal/models/shelf.py:160 journal/models/shelf.py:240 +#: journal/models/shelf.py:161 journal/models/shelf.py:241 #, python-brace-format msgid "wants to listen {item}" msgstr "想听 {item}" -#: journal/models/shelf.py:161 journal/models/shelf.py:241 +#: journal/models/shelf.py:162 journal/models/shelf.py:242 msgid "to listen" msgstr "想听" -#: journal/models/shelf.py:166 +#: journal/models/shelf.py:167 msgid "albums listening" msgstr "正在听的专辑" -#: journal/models/shelf.py:167 journal/models/shelf.py:247 +#: journal/models/shelf.py:168 journal/models/shelf.py:248 msgid "start listening" msgstr "在听" -#: journal/models/shelf.py:168 journal/models/shelf.py:248 +#: journal/models/shelf.py:169 journal/models/shelf.py:249 #, python-brace-format msgid "started listening {item}" msgstr "在听 {item}" -#: journal/models/shelf.py:169 journal/models/shelf.py:249 +#: journal/models/shelf.py:170 journal/models/shelf.py:250 msgid "listening" msgstr "在听" -#: journal/models/shelf.py:174 +#: journal/models/shelf.py:175 msgid "albums listened" msgstr "听过的专辑" -#: journal/models/shelf.py:175 journal/models/shelf.py:255 +#: journal/models/shelf.py:176 journal/models/shelf.py:256 msgid "finish listening" msgstr "听过" -#: journal/models/shelf.py:176 journal/models/shelf.py:256 +#: journal/models/shelf.py:177 journal/models/shelf.py:257 #, python-brace-format msgid "finished listening {item}" msgstr "听过 {item}" -#: journal/models/shelf.py:177 journal/models/shelf.py:257 +#: journal/models/shelf.py:178 journal/models/shelf.py:258 msgid "listened" msgstr "听过" -#: journal/models/shelf.py:182 +#: journal/models/shelf.py:183 msgid "albums dropped" msgstr "不再听的专辑" -#: journal/models/shelf.py:183 journal/models/shelf.py:263 +#: journal/models/shelf.py:184 journal/models/shelf.py:264 msgid "stop listening" msgstr "不听了" -#: journal/models/shelf.py:184 journal/models/shelf.py:264 +#: journal/models/shelf.py:185 journal/models/shelf.py:265 #, python-brace-format msgid "stopped listening {item}" msgstr "不听了 {item}" -#: journal/models/shelf.py:185 journal/models/shelf.py:265 +#: journal/models/shelf.py:186 journal/models/shelf.py:266 msgid "stopped listening" msgstr "不听了" -#: journal/models/shelf.py:190 +#: journal/models/shelf.py:191 msgid "albums reviewed" msgstr "评论过的专辑" -#: journal/models/shelf.py:198 +#: journal/models/shelf.py:199 msgid "games to play" msgstr "想玩的游戏" -#: journal/models/shelf.py:199 +#: journal/models/shelf.py:200 msgid "want to play" msgstr "想玩" -#: journal/models/shelf.py:200 +#: journal/models/shelf.py:201 #, python-brace-format msgid "wants to play {item}" msgstr "想玩 {item}" -#: journal/models/shelf.py:201 +#: journal/models/shelf.py:202 msgid "to play" msgstr "想玩" -#: journal/models/shelf.py:206 +#: journal/models/shelf.py:207 msgid "games playing" msgstr "正在玩的游戏" -#: journal/models/shelf.py:207 +#: journal/models/shelf.py:208 msgid "start playing" msgstr "在玩" -#: journal/models/shelf.py:208 +#: journal/models/shelf.py:209 #, python-brace-format msgid "started playing {item}" msgstr "在玩 {item}" -#: journal/models/shelf.py:209 +#: journal/models/shelf.py:210 msgid "playing" msgstr "在玩" -#: journal/models/shelf.py:214 +#: journal/models/shelf.py:215 msgid "games played" msgstr "玩过的游戏" -#: journal/models/shelf.py:215 +#: journal/models/shelf.py:216 msgid "finish playing" msgstr "玩过" -#: journal/models/shelf.py:216 +#: journal/models/shelf.py:217 #, python-brace-format msgid "finished playing {item}" msgstr "玩过 {item}" -#: journal/models/shelf.py:217 +#: journal/models/shelf.py:218 msgid "played" msgstr "玩过" -#: journal/models/shelf.py:222 +#: journal/models/shelf.py:223 msgid "games dropped" msgstr "不再玩的游戏" -#: journal/models/shelf.py:223 +#: journal/models/shelf.py:224 msgid "stop playing" msgstr "不玩了" -#: journal/models/shelf.py:224 +#: journal/models/shelf.py:225 #, python-brace-format msgid "stopped playing {item}" msgstr "不再玩 {item}" -#: journal/models/shelf.py:225 +#: journal/models/shelf.py:226 msgid "stopped playing" msgstr "不玩了" -#: journal/models/shelf.py:230 +#: journal/models/shelf.py:231 msgid "games reviewed" msgstr "评论过的游戏" -#: journal/models/shelf.py:238 +#: journal/models/shelf.py:239 msgid "podcasts to listen" msgstr "想听的播客" -#: journal/models/shelf.py:246 +#: journal/models/shelf.py:247 msgid "podcasts listening" msgstr "正在听的播客" -#: journal/models/shelf.py:254 +#: journal/models/shelf.py:255 msgid "podcasts listened" msgstr "听过的播客" -#: journal/models/shelf.py:262 +#: journal/models/shelf.py:263 msgid "podcasts dropped" msgstr "不再听的播客" -#: journal/models/shelf.py:270 +#: journal/models/shelf.py:271 msgid "podcasts reviewed" msgstr "评论过的播客" -#: journal/models/shelf.py:278 +#: journal/models/shelf.py:279 msgid "performances to see" msgstr "想看的演出" -#: journal/models/shelf.py:279 +#: journal/models/shelf.py:280 msgid "want to see" msgstr "想看" -#: journal/models/shelf.py:280 +#: journal/models/shelf.py:281 #, python-brace-format msgid "wants to see {item}" msgstr "想看 {item}" -#: journal/models/shelf.py:281 +#: journal/models/shelf.py:282 msgid "to see" msgstr "想看" -#: journal/models/shelf.py:288 +#: journal/models/shelf.py:289 msgid "performances saw" msgstr "看过的演出" -#: journal/models/shelf.py:289 +#: journal/models/shelf.py:290 msgid "finish seeing" msgstr "看过" -#: journal/models/shelf.py:290 +#: journal/models/shelf.py:291 #, python-brace-format msgid "finished seeing {item}" msgstr "看过 {item}" -#: journal/models/shelf.py:291 +#: journal/models/shelf.py:292 msgid "seen" msgstr "看过" -#: journal/models/shelf.py:296 +#: journal/models/shelf.py:297 msgid "performances dropped" msgstr "不再看的演出" -#: journal/models/shelf.py:297 +#: journal/models/shelf.py:298 msgid "stop seeing" msgstr "不看了" -#: journal/models/shelf.py:298 +#: journal/models/shelf.py:299 #, python-brace-format msgid "stopped seeing {item}" msgstr "不再看 {item}" -#: journal/models/shelf.py:299 +#: journal/models/shelf.py:300 msgid "stopped seeing" msgstr "不看了" -#: journal/models/shelf.py:304 +#: journal/models/shelf.py:305 msgid "performances reviewed" msgstr "评论过的演出" -#: journal/models/shelf.py:566 +#: journal/models/shelf.py:609 msgid "removed mark" msgstr "移除标记" @@ -3200,46 +3203,58 @@ msgstr "评论" msgid "Update note" msgstr "修改备注" -#: journal/templates/_sidebar_search_journal.html:4 -msgid "Addtional filters may be added to query" -msgstr "可使用额外的筛选条件" +#: journal/templates/_sidebar_search_journal.html:5 +msgid "Search filters" +msgstr "搜索过滤条件" -#: journal/templates/_sidebar_search_journal.html:6 +#: journal/templates/_sidebar_search_journal.html:8 msgid "filter by one of these statuses" msgstr "筛选以下标记状态" -#: journal/templates/_sidebar_search_journal.html:9 +#: journal/templates/_sidebar_search_journal.html:11 msgid "filter by rating range" msgstr "筛选评分范围" -#: journal/templates/_sidebar_search_journal.html:12 +#: journal/templates/_sidebar_search_journal.html:14 msgid "filter unrated" msgstr "筛选未评分" -#: journal/templates/_sidebar_search_journal.html:15 +#: journal/templates/_sidebar_search_journal.html:17 msgid "filter by tag" msgstr "筛选标签" -#: journal/templates/_sidebar_search_journal.html:18 +#: journal/templates/_sidebar_search_journal.html:20 msgid "filter by one of these categories" msgstr "筛选以下条目分类" -#: journal/templates/_sidebar_search_journal.html:21 +#: journal/templates/_sidebar_search_journal.html:23 msgid "filter by one of these types" msgstr "筛选以下种类的动态" -#: journal/templates/_sidebar_search_journal.html:24 +#: journal/templates/_sidebar_search_journal.html:26 msgid "filter by date" msgstr "筛选日期" -#: journal/templates/_sidebar_search_journal.html:27 +#: journal/templates/_sidebar_search_journal.html:29 msgid "filter by month" msgstr "筛选月份" -#: journal/templates/_sidebar_search_journal.html:30 +#: journal/templates/_sidebar_search_journal.html:32 msgid "filter by date range" msgstr "筛选日期范围" +#: journal/templates/_sidebar_search_journal.html:35 +msgid "sort by one of these fields" +msgstr "按照以下字段排序" + +#: journal/templates/_sidebar_search_journal.html:35 +msgid "from new to old" +msgstr "从新到旧" + +#: journal/templates/_sidebar_search_journal.html:35 +msgid "from high to low" +msgstr "从高到低" + #: journal/templates/_sidebar_user_mark_list.html:61 msgid "sorting" msgstr "排序" @@ -3748,6 +3763,10 @@ msgstr "链接无效" msgid "{review_title} - a review of {item_title}" msgstr "{review_title} - 关于 {item_title} 的评论" +#: journal/views/review.py:142 +msgid "may contain spoiler or triggering content" +msgstr "可能包含剧透或敏感内容" + #: journal/views/tag.py:41 journal/views/tag.py:55 msgid "Invalid tag" msgstr "无效标签" @@ -4518,129 +4537,149 @@ msgstr "永久删除" msgid "Data Management" msgstr "数据管理" -#: users/templates/users/data.html:20 +#: users/templates/users/data.html:27 msgid "Import Marks and Reviews from Douban" msgstr "导入豆瓣标记和评论" -#: users/templates/users/data.html:25 +#: users/templates/users/data.html:32 msgid "Select .xlsx exported from Doufen" msgstr "在豆伴(豆坟)导出时勾选书影音游剧评论
选择从豆伴(豆坟)导出的.xlsx文件" -#: users/templates/users/data.html:28 users/templates/users/data.html:195 +#: users/templates/users/data.html:35 users/templates/users/data.html:178 msgid "Import Method" msgstr "导入方式" -#: users/templates/users/data.html:31 +#: users/templates/users/data.html:38 msgid "Merge: only update when status changes from wishlist to in-progress, or from in-progress to complete." msgstr "自动合并:仅更新正向变化(未标->想读->在读->已读)标记,不更新其它标记和现有评论(推荐)" -#: users/templates/users/data.html:35 +#: users/templates/users/data.html:42 msgid "Overwrite: update all imported status." msgstr "强制覆盖:覆盖已存在的标记和评论,导入文件中未涉及的条目标记和评论不会被改动。" -#: users/templates/users/data.html:68 +#: users/templates/users/data.html:75 msgid "Another import is in progress, starting a new import may cause issues, sure to import?" msgstr "短期重复上传可能有无法预期的效果,确定现在上传导入吗?" -#: users/templates/users/data.html:68 +#: users/templates/users/data.html:75 msgid "Import in progress, please wait" msgstr "备份文件已上传,请等待导入完成或刷新页面查看最新进度" -#: users/templates/users/data.html:68 users/templates/users/data.html:87 -#: users/templates/users/data.html:168 users/templates/users/data.html:211 +#: users/templates/users/data.html:75 users/templates/users/data.html:111 +#: users/templates/users/data.html:166 users/templates/users/data.html:220 +#: users/templates/users/data.html:280 msgid "Import" msgstr "导入" -#: users/templates/users/data.html:77 +#: users/templates/users/data.html:81 msgid "Import Shelf or List from Goodreads" msgstr "导入Goodreads书架或书单" -#: users/templates/users/data.html:81 +#: users/templates/users/data.html:85 msgid "Link to Goodreads Profile / Shelf / List" msgstr "Goodreads个人主页、书架或书单链接" -#: users/templates/users/data.html:91 users/templates/users/data.html:173 -#: users/templates/users/data_import_status.html:2 -msgid "Last import started" -msgstr "最近导入时间" +#: users/templates/users/data.html:90 +msgid "want-to-read / currently-reading / read books and their reviews will be imported." +msgstr "提交Goodreads用户主页链接将导入想读、在读、已读列表,每本书的评论导入为本站短评。" -#: users/templates/users/data.html:92 users/templates/users/data.html:174 -#: users/templates/users/data.html:228 users/templates/users/data.html:246 -#: users/templates/users/data.html:263 +#: users/templates/users/data.html:95 +msgid "Shelf will be imported as a new collection." +msgstr "Goodreads书架将被导入为收藏单,每本书的评论导入为收藏单条目备注。" + +#: users/templates/users/data.html:100 +msgid "List will be imported as a new collection." +msgstr "Goodreads书单将被导入为收藏单,每本书的评论导入为收藏单条目备注。" + +#: users/templates/users/data.html:119 +msgid "Import from Letterboxd" +msgstr "导入Letterboxd标记" + +#: users/templates/users/data.html:167 +msgid "Only forward changes(none->to-watch->watched) will be imported." +msgstr "导入时仅更新正向变化(未标->想看->已看)标记;不足360字符的评论会作为短评添加。" + +#: users/templates/users/data.html:174 +msgid "Import Podcast Subscriptions" +msgstr "导入播客订阅列表 (OPML)" + +#: users/templates/users/data.html:185 +msgid "Mark as listening" +msgstr "标记为在听" + +#: users/templates/users/data.html:189 +msgid "Import as a new collection" +msgstr "导入为新收藏单" + +#: users/templates/users/data.html:218 +msgid "Select OPML file" +msgstr "选择OPML文件" + +#: users/templates/users/data.html:228 +msgid "Import NeoDB Archive" +msgstr "导入NeoDB备份" + +#: users/templates/users/data.html:234 +msgid "Upload a .zip file containing .csv or .ndjson files exported from NeoDB." +msgstr "上传从NeoDB导出的内含.csv.ndjson文件.zip压缩包。" + +#: users/templates/users/data.html:236 +msgid "Existing data may be overwritten." +msgstr "现有数据可能会被覆盖。" + +#: users/templates/users/data.html:246 +msgid "Detected format" +msgstr "检测到格式" + +#: users/templates/users/data.html:307 +msgid "Detecting format..." +msgstr "检测格式中" + +#: users/templates/users/data.html:333 +msgid "Unknown format" +msgstr "未知格式" + +#: users/templates/users/data.html:358 +msgid "Error detecting format" +msgstr "检测格式出错" + +#: users/templates/users/data.html:382 +msgid "Export NeoDB Archive" +msgstr "导出NeoDB备份" + +#: users/templates/users/data.html:386 +msgid "Export marks, reviews and notes in CSV" +msgstr "导出标记、短评和评论 (CSV格式)" + +#: users/templates/users/data.html:393 +msgid "Export everything in NDJSON" +msgstr "导出标记、短评和评论 (NDJSON格式)" + +#: users/templates/users/data.html:404 +msgid "Export marks and reviews in XLSX (Doufen format)" +msgstr "导出标记、短评和评论 (豆坟xlsx格式)" + +#: users/templates/users/data.html:407 +msgid "Last export" +msgstr "最近导出" + +#: users/templates/users/data.html:408 #: users/templates/users/data_import_status.html:3 msgid "Status" msgstr "状态" -#: users/templates/users/data.html:101 -msgid "want-to-read / currently-reading / read books and their reviews will be imported." -msgstr "提交Goodreads用户主页链接将导入想读、在读、已读列表,每本书的评论导入为本站短评。" - -#: users/templates/users/data.html:105 -msgid "Shelf will be imported as a new collection." -msgstr "Goodreads书架将被导入为收藏单,每本书的评论导入为收藏单条目备注。" - -#: users/templates/users/data.html:109 -msgid "List will be imported as a new collection." -msgstr "Goodreads书单将被导入为收藏单,每本书的评论导入为收藏单条目备注。" - -#: users/templates/users/data.html:120 -msgid "Import from Letterboxd" -msgstr "导入Letterboxd标记" - -#: users/templates/users/data.html:170 -msgid "Only forward changes(none->to-watch->watched) will be imported." -msgstr "导入时仅更新正向变化(未标->想看->已看)标记;不足360字符的评论会作为短评添加。" - -#: users/templates/users/data.html:178 -msgid "Failed links, likely due to Letterboxd error, you may have to mark them manually" -msgstr "导入失败的链接(通常由于Letterboxd的信息错误,请手工添加标记)" - -#: users/templates/users/data.html:189 -msgid "Import Podcast Subscriptions" -msgstr "导入播客订阅列表 (OPML)" - -#: users/templates/users/data.html:202 -msgid "Mark as listening" -msgstr "标记为在听" - -#: users/templates/users/data.html:206 -msgid "Import as a new collection" -msgstr "导入为新收藏单" - -#: users/templates/users/data.html:209 -msgid "Select OPML file" -msgstr "选择OPML文件" - -#: users/templates/users/data.html:218 -msgid "Export Data" -msgstr "导出数据" - -#: users/templates/users/data.html:224 -msgid "Export marks and reviews in XLSX (Doufen format)" -msgstr "导出标记、短评和评论 (豆坟xlsx格式)" - -#: users/templates/users/data.html:227 users/templates/users/data.html:245 -#: users/templates/users/data.html:262 -msgid "Last export" -msgstr "最近导出" - -#: users/templates/users/data.html:232 users/templates/users/data.html:250 -#: users/templates/users/data.html:267 +#: users/templates/users/data.html:412 msgid "Download" msgstr "下载" -#: users/templates/users/data.html:242 -msgid "Export marks, reviews and notes in CSV" -msgstr "导出标记、短评和评论 (CSV格式)" - -#: users/templates/users/data.html:259 -msgid "Export everything in NDJSON" -msgstr "导出标记、短评和评论 (NDJSON格式)" - -#: users/templates/users/data.html:275 +#: users/templates/users/data.html:420 msgid "View Annual Summary" msgstr "查看年度小结" +#: users/templates/users/data_import_status.html:2 +msgid "Last import started" +msgstr "最近导入时间" + #: users/templates/users/data_import_status.html:11 msgid "Failed links, you may have to mark them manually" msgstr "导入失败的链接(请手工添加标记)" @@ -4977,6 +5016,10 @@ msgstr "导出" msgid "You may download the list here." msgstr "此处可导出你在本站的关系列表。" +#: users/templates/users/user_task_status.html:29 +msgid "Failed items" +msgstr "失败条目" + #: users/templates/users/verify.html:22 msgid "Please enter the verification code you received." msgstr "请输入收到的验证码。" @@ -5041,42 +5084,34 @@ msgstr "账户删除进行中。" msgid "Account mismatch." msgstr "账号信息不匹配。" -#: users/views/data.py:131 users/views/data.py:168 users/views/data.py:200 -msgid "Generating exports." -msgstr "正在生成导出文件。" - -#: users/views/data.py:137 users/views/data.py:174 users/views/data.py:206 +#: users/views/data.py:174 users/views/data.py:203 msgid "Export file not available." msgstr "导出文件不可用。" -#: users/views/data.py:149 +#: users/views/data.py:197 +msgid "Generating exports." +msgstr "正在生成导出文件。" + +#: users/views/data.py:215 msgid "Export file expired. Please export again." msgstr "导出文件已失效,请重新导出" -#: users/views/data.py:164 users/views/data.py:196 +#: users/views/data.py:230 users/views/data.py:250 msgid "Recent export still in progress." msgstr "正在导出" -#: users/views/data.py:222 +#: users/views/data.py:264 msgid "Sync in progress." msgstr "正在同步。" -#: users/views/data.py:236 +#: users/views/data.py:278 msgid "Settings saved." msgstr "设置已保存" -#: users/views/data.py:250 -msgid "Import in progress." -msgstr "正在导出" - -#: users/views/data.py:252 +#: users/views/data.py:288 msgid "Invalid URL." msgstr "无效网址。" -#: users/views/data.py:270 users/views/data.py:320 +#: users/views/data.py:303 users/views/data.py:328 users/views/data.py:352 msgid "Invalid file." msgstr "无效文件。" - -#: users/views/data.py:279 users/views/data.py:302 users/views/data.py:317 -msgid "File is uploaded and will be imported soon." -msgstr "文件已上传,等待后台导入。" diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 3083d6bf..00000000 --- a/mkdocs.yml +++ /dev/null @@ -1,55 +0,0 @@ -site_name: 🧩 NeoDB -site_url: https://neodb.net -repo_url: http://github.com/neodb-social/neodb -edit_uri: blob/main/docs/ -site_description: Mark the things you love. -nav: - - Overview: 'index.md' - - features.md - - servers.md - - apps.md - - install.md - - upgrade.md - - configuration.md - - troubleshooting.md - - development.md - - api.md - - origin.md -theme: - logo: assets/logo.svg - name: material - font: - text: Lato - palette: - primary: custom - accent: custom - features: - # - navigation.tabs - # - navigation.footer - custom_dir: docs/templates -extra: - social: - - icon: fontawesome/brands/mastodon - link: https://mastodon.online/@neodb/ - - icon: fontawesome/brands/bluesky - link: https://bsky.app/profile/neodb.net - - icon: fontawesome/brands/x-twitter - link: https://twitter.com/NeoDBsocial - - icon: fontawesome/brands/threads - link: https://www.threads.net/@neodb.social - - icon: fontawesome/brands/discord - link: https://discord.gg/QBHkrV8bxK - - icon: fontawesome/brands/github - link: http://github.com/neodb-social/neodb - - icon: fontawesome/brands/docker - link: https://hub.docker.com/u/neodb -extra_css: - - stylesheets/extra.css -markdown_extensions: - - pymdownx.superfences: - custom_fences: - - name: mermaid - class: mermaid - format: !!python/name:pymdownx.superfences.fence_code_format -hooks: - - mkdocs_hook.py diff --git a/mkdocs_hook.py b/mkdocs_hook.py deleted file mode 100644 index 234d08b6..00000000 --- a/mkdocs_hook.py +++ /dev/null @@ -1,26 +0,0 @@ -import json - - -def on_page_markdown(markdown, page, config, **kwargs): - if page.url == "servers/": - with open(config.docs_dir + "/servers.json") as f: - servers = json.load(f) - m = "" - for s in servers["servers"]: - host = s["host"] - name = s.get("name", host) - admin = s.get("admin", []) - label = s.get("label", []) - language = s.get("language", []) - description = s.get("description", "") - m += f" - **[{name}](https://{host})**" - if label: - m += f" {' '.join([f'`{a}`' for a in label])}" - if language: - m += f" {' '.join([f'`{a}`' for a in language])}" - if description: - m += f" \n {description}" - if admin: - m += f" \n admin: {', '.join([f'`{a}`' for a in admin])}" - m += "\n" - return markdown.replace("{servers}", m) diff --git a/requirements-dev.lock b/requirements-dev.lock index aa871438..96d586fc 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -9,7 +9,7 @@ # generate-hashes: false # universal: false -aiohappyeyeballs==2.4.6 +aiohappyeyeballs==2.5.0 # via aiohttp aiohttp==3.11.13 # via discord-py @@ -62,10 +62,10 @@ cssbeautifier==1.15.4 # via djlint dateparser==1.2.1 deepmerge==2.0 -discord-py==2.5.0 +discord-py==2.5.2 distlib==0.3.9 # via virtualenv -django==4.2.19 +django==4.2.20 # via django-anymail # via django-appconf # via django-auditlog @@ -130,7 +130,7 @@ httpcore==1.0.7 # via httpx httpx==0.28.1 # via atproto -identify==2.6.8 +identify==2.6.9 # via pre-commit idna==3.10 # via anyio @@ -138,7 +138,7 @@ idna==3.10 # via requests # via yarl igdb-api-v4==0.3.3 -jinja2==3.1.5 +jinja2==3.1.6 # via mkdocs # via mkdocs-material jsbeautifier==1.15.4 @@ -159,7 +159,7 @@ markdown==3.7 # via mkdocs # via mkdocs-material # via pymdown-extensions -markdownify==1.0.0 +markdownify==1.1.0 markupsafe==3.0.2 # via jinja2 # via mkdocs @@ -201,7 +201,7 @@ pre-commit==4.1.0 propcache==0.3.0 # via aiohttp # via yarl -protobuf==5.29.3 +protobuf==6.30.0 # via igdb-api-v4 psycopg2-binary==2.9.10 pycparser==2.22 @@ -252,7 +252,7 @@ rjsmin==1.2.2 # via django-compressor rq==2.1.0 # via django-rq -ruff==0.9.9 +ruff==0.9.10 sentry-sdk==2.22.0 setproctitle==1.3.5 six==1.17.0 @@ -285,7 +285,7 @@ typing-extensions==4.12.2 # via pydantic # via pydantic-core # via pyright -tzlocal==5.3 +tzlocal==5.3.1 # via dateparser urllib3==2.3.0 # via django-anymail @@ -293,7 +293,7 @@ urllib3==2.3.0 # via sentry-sdk urlman==2.0.2 validators==0.34.0 -virtualenv==20.29.2 +virtualenv==20.29.3 # via pre-commit watchdog==6.0.0 # via mkdocs diff --git a/requirements.lock b/requirements.lock index 7bccec2a..d638c763 100644 --- a/requirements.lock +++ b/requirements.lock @@ -9,7 +9,7 @@ # generate-hashes: false # universal: false -aiohappyeyeballs==2.4.6 +aiohappyeyeballs==2.5.0 # via aiohttp aiohttp==3.11.13 # via discord-py @@ -48,8 +48,8 @@ cryptography==44.0.2 # via atproto dateparser==1.2.1 deepmerge==2.0 -discord-py==2.5.0 -django==4.2.19 +discord-py==2.5.2 +django==4.2.20 # via django-anymail # via django-appconf # via django-auditlog @@ -116,7 +116,7 @@ loguru==0.7.3 lxml==5.3.1 markdown==3.7 # via django-markdownx -markdownify==1.0.0 +markdownify==1.1.0 mistune==3.1.2 multidict==6.1.0 # via aiohttp @@ -132,7 +132,7 @@ podcastparser==0.6.10 propcache==0.3.0 # via aiohttp # via yarl -protobuf==5.29.3 +protobuf==6.30.0 # via igdb-api-v4 psycopg2-binary==2.9.10 pycparser==2.22 @@ -190,7 +190,7 @@ typing-extensions==4.12.2 # via beautifulsoup4 # via pydantic # via pydantic-core -tzlocal==5.3 +tzlocal==5.3.1 # via dateparser urllib3==2.3.0 # via django-anymail diff --git a/test_data/https___music_apple_com_cn_album_1284391545 b/test_data/https___music_apple_com_cn_album_1284391545 new file mode 100644 index 00000000..daf7d8f4 --- /dev/null +++ b/test_data/https___music_apple_com_cn_album_1284391545 @@ -0,0 +1,209 @@ + + + + + + + + + + + + + + + + + + + + + + + + + ‎《Kids Only》- 窦靖童的专辑 - Apple Music + + + + + + + + + + + + + + + + + + + +
+

Kids Only

Kids Only

首张原创专辑《Stone Café》惊艳亮相后,窦靖童便开始了在音乐上的深入探索,与世界顶级音乐人合作,到世界各地演出,不断历练自己。时隔一年推出了全新的概念专辑《Kids Only》。她包办了这张专辑的词曲创作,大部分歌曲都采用了同期录制,每首歌都邀请不同的音乐人合作,多样的音乐风格加上大家现场的自由发挥,每首歌都散发着鲜活可爱而又自由肆意的气息。整张专辑最明显的一点就是对人声的处理,将人声与器乐声融合,低吟恰到好处。似她母亲王菲的唱腔,似她父亲窦唯的创作风格,但她又是如此与众不同,顽皮的孩子气、少女心事的烦忧、童年往昔的回顾、对自由的向往追求,小小年龄有大大的思虑,皆呈现于此。

选择国家或地区

非洲、中东和印度

亚太地区

欧洲

拉丁美洲和加勒比海地区

美国和加拿大

+
+ + + + + diff --git a/test_data/https___music_apple_com_fr_album_1284391545 b/test_data/https___music_apple_com_fr_album_1284391545 new file mode 100644 index 00000000..d4b43a89 --- /dev/null +++ b/test_data/https___music_apple_com_fr_album_1284391545 @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + ‎Kids Only – Album par 竇靖童 – Apple Music + + + + + + + + + + + + + + + + + + + +
+

Kids Only

Kids Only
Choisissez un pays ou une région

Afrique, Moyen‑Orient et Inde

Asie‑Pacifique

Europe

Amérique latine et Caraïbes

États‑Unis et Canada

+
+ + + + + diff --git a/test_data/https___music_apple_com_jp_album_1284391545 b/test_data/https___music_apple_com_jp_album_1284391545 new file mode 100644 index 00000000..d6fa4749 --- /dev/null +++ b/test_data/https___music_apple_com_jp_album_1284391545 @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + ‎Kids Only - リア・ドウのアルバム - Apple Music + + + + + + + + + + + + + + + + + + + +
+

Kids Only

Kids Only
国または地域を選択

アフリカ、中東、インド

アジア太平洋

ヨーロッパ

ラテンアメリカ、カリブ海地域

米国およびカナダ

+
+ + + + + diff --git a/test_data/https___music_apple_com_kr_album_1284391545 b/test_data/https___music_apple_com_kr_album_1284391545 new file mode 100644 index 00000000..c8241613 --- /dev/null +++ b/test_data/https___music_apple_com_kr_album_1284391545 @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + ‎Kids Only - 竇靖童의 앨범 - Apple Music + + + + + + + + + + + + + + + + + + + +
+
국가 또는 지역 선택

아프리카, 중동 및 인도

아시아 태평양

유럽

라틴 아메리카 및 카리브해

미국 및 캐나다

+
+ + + + + diff --git a/test_data/https___music_apple_com_us_album_1284391545 b/test_data/https___music_apple_com_us_album_1284391545 index b07debbd..c8fde71e 100644 --- a/test_data/https___music_apple_com_us_album_1284391545 +++ b/test_data/https___music_apple_com_us_album_1284391545 @@ -1,244 +1,55 @@ - - - - - - + + + + + + + + + + + + > + + > + + > + - + > + + - ‎Kids Only by Leah Dou on Apple Music - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ‎Kids Only - Album by Leah Dou - Apple Music - - - - + + + @@ -272,1636 +83,123 @@ /> - - - -
- - -
- -
- - -
- -
- - -
-
- - - - - - - - -
- -
- - -
- -

Kids Only

- -
- Leah Dou -
- -
-
- -
- -
-
-
- -
-
- -
-
+

Kids Only

- - - - - - -
-
- - - - - - Kids Only -
- -
- - -

Psychedelic electro-soul colors Dou’s second album.

-
- -
- -
- -
- - -
-
- -
- - - -
- -
- - - - - - - - - -
- - - - -
- - - - -
-
- - - -
- -
1
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - - - -
-
- - - -
- -
2
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - - - -
-
- - - -
- -
3
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - - - -
-
- - - -
- -
4
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - - - -
-
- - - -
- -
5
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - - - -
-
- - - -
- -
6
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - - - -
-
- - - -
- -
7
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - - - -
-
- - - -
- -
8
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - - - -
-
- - - -
- -
9
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - - - -
-
- - - -
- -
10
- -
-
-
- -
- - -
- -
- - - - - - - -
- -
- - - -
-
-
- - -
- - -
- - - -
- -
- -

Psychedelic electro-soul colors Dou’s second album.

- - - -
- -
- -
- - - -
- -
- - -
- -

More By Leah Dou

- -
- - - -
- - - -

More By Leah Dou

-
- - -
-
-
- - - -
- -
- - -
- -

Featured On

- -
- - - -
- - - -

Featured On

-
- - -
-
-
- - - -
- - - - - -
-
+ ">
- - - - -
- - - - - - - - - - - -
-

Select a country or region

-

Africa, Middle East, and India

-
-

Asia Pacific

-
-

Europe

-
-

Latin America and the Caribbean

-
-

The United States and Canada

-
-
-
-
- -
+ ">
Select a country or region

Africa, Middle East, and India

Asia Pacific

Europe

Latin America and the Caribbean

The United States and Canada

+ - - + +