Coder Social home page Coder Social logo

shosetsuorg / kotlin-lib Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 17.0 870 KB

MOVED TO GITLAB: Shosetsu - Base Library and Lua Support

Home Page: https://gitlab.com/shosetsuorg/kotlin-lib

License: GNU General Public License v3.0

Kotlin 86.97% Lua 13.03%
kotlin library shosetsu

kotlin-lib's People

Contributors

doomsdayrs avatar khonkhortisan avatar technojo4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kotlin-lib's Issues

NovelListing Summery and Genres

There are a lot of sites that just dont use covers or that focus more on providing a summery and the genres of the novel in the listing, having these displayed in Shosetsu instead of the cover and title would be very helpful in finding a novel that you want to read.

My proposal:

NovelListing {
    title = ""
    link = ""
    imageUrl = null or ""
+    summery = "",
+    genre = {}
}

There could also be an extension option like this

enum ListingDisplay {
    TitleAndCover, // For displaying only the title and cover
    TitleAndSummery // For displaying title, cover if imageUrl is not null or empty, summery and genres
}
return {
	id = -1,
	name = "DEFAULT",
	baseURL = baseURL,
+        listingDisplayType = ListingDisplay.TitleAndSummery
}

Interactive/Live Filters

Depends on #50

There are some sites that change the filters based on the listing and the current state of other filters. One example would be ArchiveOfOurOwn.org. When you continue to set specific filters it will trim available filters with the available work's tags. So if there are more Female Protagonist works it will show the Female Protagonist tag unless there are more of other tags.

My proposal:
Allow an extension to return a new/modified filter list when filters are applied, and allow the extension to modify the states of those filters. On ArchiveOfOurOwn.org you can exclude a tag and it will stay in the filter list, but it will be moved to the bottom. Returning a new filter list with these states set will allow the extension to make these changes.

This also requires that the filter list has loading states where some options are only possible at certain times, so the filter list would need to load filters from the network in the background.

Shosetsu has no way to know if there is no more pages

Description

When Shosetsu calls for results, either from a search or listing, there is no way to know if there are no more results. Leading to an unfortunate situation where Shosetsu will spam for a result.

Solution

Create a Result data class, parameters of the "Array<Novel.Listing>" and "hasNextPage"

Add startIndex to Extensions

Add a startIndex integer to Extensions.

This startIndex will be defaulted to 0

Developers have the option to override and set it to 1 if the website is programmed in that way.

Do not set ID=-1 in Filter

Having the ID defaulted as -1 in Filter makes it difficult to maintain UI consistency.

Each Filter should have their ID specified, even if it is a useless ID

Remove Map<Int,Any/T> from Filter.Group/List

Currently Filter.Group/List both have their states set to a Map<Int,Any/T>

This is quite redundant, as Array<Filter<*/T>> can handle the job as each child Filter already has a state.

Interactive Listing Selection

There are a few sites that have up to thousands of listing options. The easiest example would be Fanfiction.net. On Fanfiction.net you cannot get a regular list of fanfiction without first choosing one of the many options to browse. And since they continue to add more browse options a static list of listings wont last for long.

My proposal:
When clicking a extension it brings up a menu with one section of options, on Fanfiction.net these options would be Anime/Manga, Movies, and such. After that is selected it brings up another of these menus further specifying what you want to read, like Harry Potter or Naruto.

These need to be dynamically generated and even paged since things may continue to add more options, and some sites wont even have them all on the same page.

Rewrite LuaJ into LuaK

Currently kotlin-lib is dependent on an aging repository called LuaJ, that has been unmaintained for years.

Future plans is to rewrite the entirety of LuaJ in Kotlin with provide cross platform support. This will allow Shosetsu to improve the Lua experience on android, especially for other developers in the future.

Test.kt should be seperated from kotlin-lib

Currently, Test.kt is dependent on kotlin-lib, and creates this weird use case of it being in the test directory (which is used for testing the actual code of the repository).

@TechnoJo4 , Do you agree with separating it to its own repository?

Simplify Filter classes

I have a feeling that the quantity of choices in Filter are somewhat overbearing.

For example, why do we have a Switch & Checkbox. Isn't the choice unnecessary when both do the same thing? Same thing with DropDown and RadioGroup.

Is Separator even needed when it is included in a Header?

Also, List is a nightmare to code for, and should be replaced with headers.

Developer option to make a Filter.Text hide content

Add an option when creating a Filter.Text to mark it as sensitive information. Thus shosetsu can hide the contents of what is entered and save it to a secure location.

This will require a new "secure" preferences for an extension, but nothing major in Shosetsu.

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.