Glimesh / glimesh.tv

Glimesh is a next generation live streaming platform built by the community, for the community.
https://glimesh.tv
Other
465 stars 77 forks source link

Add database-driven categories of streams #19

Closed clone1018 closed 4 years ago

clone1018 commented 4 years ago
Key Description
id id
slug url safe name
name human friendly name (i18n key)
image preview card image
parent_id if this is owned by another category, which?

We can also decide if the primary nav should be driven by this table, or hardcoded for performance.

Zaeo commented 4 years ago

I wonder if we could hook into Steam's API to generate these categories automagically?

tjcasey commented 4 years ago

Some info, hope it helps:

Twitch uses Giant Bomb - https://www.giantbomb.com/api/

Mixer used to use Player.me (lags behind GB's database, new titles often missing for weeks) - https://playerme.docs.apiary.io/#reference/games

clone1018 commented 4 years ago

Here's the current draft of what categories could look like during launch:


Art
 * Digital
 * Phsyical
Music
 * 24/7 Music Stream
 * Live Band
 * DJ
Tech
 * 3D Printing
 * Live Stats
 * Programming
 * Game Development
 * Web Development
IRL
 * Animals
 * Exploration
 * Talk Show
 * News
 * Cooking
 * Studying
Education
 * Anthropology
 * Business Administration
 * Chemistry
 * Church
 * Economics
 * Engineering
 * Oceanography
 * Political Science
 * Psychology
 * Statistics
Gaming 
 * Action
 * Action-Adventure
 * Adventure
 * Board Game
 * Education
 * Fighting
 * Misc
 * MMO
 * Music
 * Party
 * Platform
 * Puzzle
 * Racing
 * Role-Playing
 * Sandbox
 * Shooter
 * Simulation
 * Sports
 * Strategy
 * Visual Novel
clone1018 commented 4 years ago

Also just in case I need to import a game list in the future....

data =
  File.stream!("vgchartz-7_7_2020.csv")
  |> Stream.map(&String.trim(&1))
  |> Stream.map(&String.split(&1, ","))
  |> Stream.map(fn [id, img, title, console, genre, publisher, developer | tail] ->
    Glimesh.Repo.insert!(
      %Glimesh.Streams.Category{
        name: title,
        slug: Slug.slugify(title),
        parent_id: Map.get(categories_to_id, genre)
      },
      on_conflict: :nothing
    )
  end)
  |> Stream.run()
clone1018 commented 4 years ago

Completed in https://github.com/Glimesh/glimesh.tv/pull/101