Files
vrobbler/vrobbler/apps/scrobbles/constants.py
Colin Powell c3673e2679 [nature] Add iNaturalist observation importer and scrobbles
- New nature app with SpeciesObservation model (scrobblable)
- SpeciesObservationLogData for observation-specific fields
- Atom feed parser + iNat REST API enrichment
- Photo download and local storage
- Celery periodic import (every 4 hours)
- Management command: import_from_inaturalist
- Species fields: title, scientific_name, taxon_id, iconic_taxon_name, rank, wikipedia_url
- Log fields: observation_id, photo_urls, quality_grade, place_guess, lat/lon, uri, identifications_count
- Updates existing scrobbles when observation data changes
- iNaturalist user mapping on UserProfile
- Templates, admin, API, URLs
- Default 5 minute run time for species observations
2026-07-16 23:43:21 -04:00

117 lines
2.9 KiB
Python

from enum import Enum
from django.db import models
JELLYFIN_VIDEO_ITEM_TYPES = ["Episode", "Movie"]
class Visibility(models.TextChoices):
PUBLIC = "public", "Public"
SHARED = "shared", "Shared"
PRIVATE = "private", "Private"
JELLYFIN_AUDIO_ITEM_TYPES = ["Audio"]
LONG_PLAY_MEDIA = {
"videogames": "VideoGame",
"books": "Book",
"bricksets": "BrickSet",
"tasks": "Task",
"papers": "Paper",
}
# Media types that should just be finished if they go over time
AUTO_FINISH_MEDIA = {
"webpages": "WebPage",
"tracks": "Track",
"videos": "Video",
"moods": "Mood",
"drinks": "Drink",
}
PLAY_AGAIN_MEDIA = {
"videos": "Video",
"music": "Track",
"podcasts": "PodcastEpisode",
"sports": "SportEvent",
"books": "Book",
"videogames": "VideoGame",
"boardgames": "BoardGame",
"locations": "GeoLocation",
"trails": "Trail",
"drinks": "Beer",
"drinks": "Wine",
"drinks": "Coffee",
"drinks": "Drink",
"puzzles": "Puzzle",
"foods": "Food",
"tasks": "Task",
"webpages": "WebPage",
"lifeevents": "LifeEvent",
"moods": "Mood",
"bricksets": "BrickSet",
"channels": "Channel",
"birds": "BirdingLocation",
"discgolf": "DiscGolfCourse",
"nature": "SpeciesObservation",
}
DRINK_MODELS = ["Beer", "Wine", "Coffee", "Drink"]
MEDIA_END_PADDING_SECONDS = {
"Video": 3600, # 60 min
}
TODOIST_TASK_URL = "https://app.todoist.com/app/task/{id}"
SCROBBLE_CONTENT_URLS = {
"-i": ["https://www.imdb.com/title/", "https://www.youtube.com/watch?v="],
"-s": ["https://www.thesportsdb.com/event/"],
"-g": ["https://boardgamegeek.com/boardgame/"],
"-u": ["https://untappd.com/"],
"-wi": [],
"-co": ["https://roastdb.com/"],
"-b": ["https://www.amazon.com/"],
"-t": ["https://app.todoist.com/app/task/{id}"],
"-p": ["https://www.ipdb.plus/IPDb/puzzle.php?id="],
"-pp": ["https://doi.org/"],
"-l": ["https://brickset.com/sets/"],
"-c": ["https://readcomicsonline.ru"],
"-h": ["https://www.twitch.tv/"],
}
EXCLUDE_FROM_NOW_PLAYING = ("GeoLocation",)
MANUAL_SCROBBLE_FNS = {
"-v": "manual_scrobble_video_game",
"-b": "manual_scrobble_book",
"-s": "manual_scrobble_event",
"-i": "manual_scrobble_video",
"-g": "manual_scrobble_board_game",
"-u": "manual_scrobble_beer",
"-wi": "manual_scrobble_wine",
"-co": "manual_scrobble_coffee",
"-w": "manual_scrobble_webpage",
"-t": "manual_scrobble_task",
"-p": "manual_scrobble_puzzle",
"-l": "manual_scrobble_brickset",
"-c": "manual_scrobble_book",
"-f": "manual_scrobble_food",
"-d": "manual_scrobble_drink",
"-h": "manual_scrobble_twitch_channel",
"-dg": "manual_scrobble_discgolf",
"-pp": "manual_scrobble_paper",
}
class AsTsvColumn(Enum):
ARTIST_NAME = 0
ALBUM_NAME = 1
TRACK_NAME = 2
TRACK_NUMBER = 3
RUN_TIME_SECONDS = 4
COMPLETE = 5
TIMESTAMP = 6
MB_ID = 7