Giter Club home page Giter Club logo

moviepolls's Introduction

Overview

Purpose

A more democratic process for selecting a movie to watch, allowing users to suggest and vote on movies to watch.

Specific features

Note: not all of this stuff is implemented yet.

  • Twitch OAuth to verify users
  • Running totals (see below)
  • (optional) Email reminders on movies voted for
  • Links to movie details (IMDB, AniDB, MAL, etc.)
  • Info on the upcoming MovieNight (if a planned end date is set)
  • Link to MovieNight stream if live?
  • Movie history (selected movies and dates watched)
  • Votes decay (eg., only last for a given number of cycles)

In-depth Explanation

Users are given a fixed number of vote points. One vote = one point. Each user is allowed to only vote once per movie, regardless of the number of available points. Users can re-distribute or undo their votes during an active cycle.

Once a movie is chosen, that movie is added to a "watched/chosen" list and cannot be re-added (admin overwritable?). Users that had voted on the selected movie will get their vote points back that can be used for the next movie.

Movies can only be removed if they have zero votes after a cycle, if they are chosen, or if an admin or mod removes them. Movies that are removed after zero votes can be re-added at a later cycle, movies removed by an admin or mod cannot.

A cycle is defined as the time between two movie nights. Typically one or two weeks. A cycle is reset by an admin or a mod. Resetting a cycle chooses a movie and the process described above starts. The admin or mod that resets the cycle can define the number of movies to choose for that cycle.

Once a cycle is reset, notifications are sent out to users that have opted into receiving notifications. Notifications WILL NOT be an opt-out but instead an opt-in process. Users should not receive notifications if they do not explicitly approve beforehand. Removing approval for notifications should be a single-click process.

Movies can be suggested at any time by a user. Once a movie is added it is immediately available for voting. The exception to this is if the server is configured to require admin or mod approval for each suggestion. Movies can only be added if they have not been previously removed by an admin or mod.

Adding a movie must include the name and at least one link for more information. The link should be to either IMDB, AniDB, or MAL. Possibly auto-fetch info for a short synopsis and a cover image.

A vote for a selection will decay after a configurable number of cycles (default two?). A decayed vote will be removed from the selection it was assigned and re-add a vote point to the user that cast the vote.

Data Backends

  • MySQL (default b/c I can offload it on my hosting)
  • PostgreSQL
  • Flat file JSON (meant mainly for developing and debugging)

Mod/Admin differences

Mod and Admin abilities:

  • Approve/Deny pending entries
  • Ban/Unban users
  • Re-add existing/duplicate entry
  • End cycle
  • Ignore rate limit
  • Trigger cycle notifications

Admin only:

  • Add new user
  • Edit existing user (eg, change password, change privilage level)
  • Change server configuraton settings
  • Dedicated login at /admin/login (available even when the simple login method is disabled)
  • Test notifications

Contribution

If you want to contribute to this project take a look at contributing.md

License

This project is licensed under the MIT license. See license.md for details.

moviepolls's People

Contributors

cptpie avatar flyken271 avatar joeyak avatar riddlew avatar zorchenhimer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

moviepolls's Issues

Maybe use an ORM

I was interested how other go projects handle their db stuff and took a look on gitea. They seem to use https://gitea.com/xorm/xorm which abstracts the specific db as well as table generation from structs etc.

I know you dont want to introduce external dependencies but this might lower the db pain, esp when some changes in the table Layouts are still likely.

Voting Limit Restriction doesnt appear to work

When creating more than 5 movies (i.e. 6) and voting for each one results in one vote for each movie (even though the user only has 5 votes).
In the account page the available votes are displayed as -1
image

Use CSRF tokens

Pages that will need these:

  • User Login
  • User Account
  • Add Movie

I'm not too concerned about adding CSRF tokens to the admin pages, but they should probably be added there eventually too.

Restrict Jikan API results to only movies

For certain usecases only movies should be able to be added (i.e. Zorchs Movienight).
Still it should be optional to filter to only movies (or only one episode series) and be configurable in the admin panel.
Also a total "ban" of certain "tags" (see https://imgur.com/a/qB6Cuie for reference) should be configurable.
Maybe also make the max amount of episodes configurable.

For the episodes the field "episodes" on the same level as the title should be used.
For the entrytype the field "type" is used (see above link for reference).

Panic when adding a MAL manga link

This should give an error, not panic the server:
image

Looks like the regex matches slice isn't checked for non-empty before trying to access it at server.go:363

Add a github "banner"

We should add a small banner/button/something else to advertise this repository to an average user.

Movie history

We already have all movies saved in the database with the corresponding cycle dates.
It should be feasible to display some sort of history (maybe combined with the search functionality).

Movie Management

Similar to #31, only for movies instead of users.

  • Delete a movie
  • Edit a movie's details (title, description, links, poster)
  • Force-add a movie (eg, a duplicate)

Add OAuth login backend

Add the ability to create an account, and login with an OAuth account from another service. Allow linking an additional OAuth account after the first account is created. Focus on:

  • Twitch
  • Discord
  • Patreon

Implement Poster upload

This feature was planned from the beginning but not implemented yet, let's change that.

A user should be able to choose a picture from the local disk and upload it to the moviepolls server.
The file then should be saved within the posters folder (as done with the api posters).
The file upload dialog is already handled by the browser (its a default html file upload).

Nice to haves:

  • Drag and Drop

User management

User management in the admin panel needs a lot of work. Namely:

  • Deleting a user
  • Reset passwords (a better method than just typing in a new one. force change?)
  • Banning a user (IP & cookie ban?)
  • Renaming a user
  • Promote user to Mod or Admin (or generate a url/key pair for a user to use. or both?)
  • Probably more stuff I'm forgetting right now.

EDIT:
When deleting a user give the option to delete that user's votes.

Add the option to add Remarks to a added movie

Either when adding a movie or/and afterwards.
Size wise 200-250 chars would be enough.
This field would be intended for notes which will be displayed when selecting movies (i.e. "please watch the b/w version").

Requirements:

  • Addition of a remarks field in the movie struct
    • Adapt the db connectors
  • Addition of a remarks field on "add-movie.html"
    • This field should also be filled when autofill is used (the only field that does not get ignored)
  • Render remarks on movie-info.html
  • Render remarks on cycle end view for the admin

Remove tracking elements from URL's

IMDB links typically have a tracking component tacked on the end of the URL: ?ref_=[...]. These should be removed before saving the link to the database.

Text input length limits

Limit the length of the various text input fields. Username was already added, but does need to be tweaked to not count zero width spaces (and other weird space characters).

  • Movie Title
  • Movie Description
  • Movie Links

User can vote for already watched movies when searching for them

When a user uses the search functionality from #7 and a cycle is currently running, the vote button is rendered for the already watched movie, when voting the server returns code 400.
Error Message in console: Unable to cast vote: Movie has already been watched

Maybe we should give the user a better response than "something went wrong".

Removing vote when max votes used gives error

I have used all three votes, and when I click "Remove", I get an error saying I have no votes. I clicked on westworld on the main site, and it sent me to https://moviepolls.zorchenhimer.com/vote/67
image
image

Movie Decay

Similar to vote decay, but for movies.

Auto-remove a movie after N cycles if it doesn't have any votes at the next cycle end. The number of cycles should be configurable, and must be a higher value than the vote decay setting.

Edit Cycle's Planned End

The "Planned End" value for the current cycle should probably be modifiable. There isn't any mechanism to do this yet aside from modifying the database directly.

Info on upcoming MovieNight

The MoviePolls site should crossreference to the corresponding MovieNight instance to direct users there when a movie is watched.

Requirements:
Show some sort of notification if a movienight is planned (and/or running)
- maybe with some sort of closeable banner?
Save link to the MovieNight instance in the database

Questions to be asked:
Maybe use a countdown for the upcoming movienight?
Should we request the movienight url to check if the movie is running already?

Paginate /history

Paginate the list on the history page. Currently, it only displays the previous 10 cycles.

Rewrite add movie logic

Clean up input tests
Improve enabled/disabled handling
extract logic into distinct functions to improve readability

Moderator role

In the readme you described a moderator and admin role and the differences, do you still intend to use that approach?
It seems to be overkill to add an additional moderator role for the currently expected usecases.

PSQL Connector

Implement a postgresql connector via the database interface

Support tags for movies

It would be nice to have some tags (i.e. "drama", "comedy") for movies.
It would also be nice to have the ability to filter for a tag (i.e. all movies with the "drama" tag).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.