diff --git a/stashr/api.py b/stashr/api.py index 37f61bd..a07bd61 100644 --- a/stashr/api.py +++ b/stashr/api.py @@ -2262,6 +2262,58 @@ def api_put_directories_edit(scrape_id): return jsonify(create_json_return('200')) +@api.route('/scrape/directories/extend/', methods=['POST']) +def api_post_directories_extend(scrape_id): + """To Update Later + This is using docstrings for specifications. + --- + tags: + - scrape + """ + + user = current_user + + if not user.is_authenticated: + if not request.json: + return jsonify(create_json_return('400')) + if "api_key" not in request.json: + return jsonify(create_json_return('400')) + if request.json['api_key'] == "": + return jsonify(create_json_return('100')) + + user = database.session \ + .query(database.Users) \ + .filter(database.Users.api_key == request.json['api_key']) \ + .first() + + if user is None: + return jsonify(create_json_return('100')) + + if user.role != 'admin': + return jsonify(create_json_return('401')) + + allowed_keys = [ + 'search_terms' + ] + + for key, value in request.json['data'].items(): + if key not in allowed_keys: + return jsonify(create_json_return('400')) + + if "data" not in request.json: + return jsonify(create_json_return('400')) + if "search_terms" not in request.json['data']: + return jsonify(create_json_return('400')) + + search_terms = request.json['data']['search_terms'] + + # DO THINGS HERE + utils.new_scrape_extend_matches(scrape_id, search_terms) + # tasks.extend_scrape(scrape_id) + + return jsonify(create_json_return('200')) + + """ --- PLUGIN UPLOAD/INSTALL --- """ diff --git a/stashr/static/assets/title.svg b/stashr/static/assets/title.svg new file mode 100644 index 0000000..ebef43e --- /dev/null +++ b/stashr/static/assets/title.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + diff --git a/stashr/static/css/stashr.css b/stashr/static/css/stashr.css index 170d2a5..6de1e6c 100644 --- a/stashr/static/css/stashr.css +++ b/stashr/static/css/stashr.css @@ -31,7 +31,7 @@ ul { list-style-type: none; } .stashr-poster_wrapper { position:relative; overflow:hidden; } .stashr-link { text-decoration: none; } .stashr-button_container {position:fixed;bottom:10;right:10;opacity:.7;z-index:999;} -.stashr-menu_button_container {position:fixed;bottom:10;left:10;opacity:.7;z-index:999;} +.stashr-menu_button {position:fixed;bottom:0;border-top-right-radius:25%;border-bottom-right-radius:25%;z-index:999;} .stashr-reader { background:black; } .new-stashr-button_container { opacity:.7; } diff --git a/stashr/templates/all_collections_page.html b/stashr/templates/all_collections_page.html index 289eab1..ba85a8b 100644 --- a/stashr/templates/all_collections_page.html +++ b/stashr/templates/all_collections_page.html @@ -30,9 +30,12 @@ Vue.component('collections', { props: ['collections'], template: `
-
-
- +
+
+ + + +
    @@ -42,6 +45,15 @@ Vue.component('collections', { v-bind:key="collection.collection_id" >
+
+
+
Collections
+ +
+
+ +
+
`, data() { return { search: '', } }, diff --git a/stashr/templates/all_volumes_page.html b/stashr/templates/all_volumes_page.html index b62c9f6..d17cb8f 100644 --- a/stashr/templates/all_volumes_page.html +++ b/stashr/templates/all_volumes_page.html @@ -136,53 +136,6 @@ Vue.component('volumes', {
-
-
Sort/Filter
+
New Releases
@@ -195,6 +195,13 @@ Vue.component('releases', {
+
+
+ +
diff --git a/stashr/templates/reading_list_page.html b/stashr/templates/reading_list_page.html index cd0f726..6df7da5 100644 --- a/stashr/templates/reading_list_page.html +++ b/stashr/templates/reading_list_page.html @@ -101,8 +101,11 @@ Vue.component('issues', { template: `
-
    @@ -112,6 +115,20 @@ Vue.component('issues', { v-bind:key="issue.issue_id" >
+
+
+
Reading List
+ +
+
+
+ +
+
+
`, data() { return { loading: true, search: '', } }, diff --git a/stashr/templates/scrape_page.html b/stashr/templates/scrape_page.html index c374093..4e35eb7 100644 --- a/stashr/templates/scrape_page.html +++ b/stashr/templates/scrape_page.html @@ -66,14 +66,17 @@ Vue.component('modal', {
- +
+ + +
[[ match['name'] ]] ([[ match['start_year'] ]])

@@ -185,9 +188,12 @@ Vue.component('directories', { props: ['directories'], template: `
-
-
- +
+
+ + + +
    @@ -197,6 +203,24 @@ Vue.component('directories', { v-bind:key="directory.scrape_id" >
+
+
+
Scrape
+ +
+
+
+ + +
+
+
`, data() { return { search: '', } }, diff --git a/stashr/templates/settings_page.html b/stashr/templates/settings_page.html index fa6042a..5f26272 100644 --- a/stashr/templates/settings_page.html +++ b/stashr/templates/settings_page.html @@ -42,7 +42,7 @@
@@ -121,18 +121,12 @@ -
- -
- -
- -
- diff --git a/stashr/templates/single_collection_page.html b/stashr/templates/single_collection_page.html index 0c4ab69..1c80e6f 100644 --- a/stashr/templates/single_collection_page.html +++ b/stashr/templates/single_collection_page.html @@ -201,6 +201,52 @@ Vue.component('collection-modals', { Vue.component('collection-jumbo', { props: ['collection'], template: ` +
+
+
+
+
+
+ + [[ collection.collection_name ]] + + +
+ + + [[ statusText ]] + + + + [[ collection.user.username ]] + +
+
+
+
+ + + +
+
+
+
+
[[ collection.collection_name ]]
+ +
+
+ + +
+
+
+ `, computed: { statusClass() { diff --git a/stashr/templates/single_volume_page.html b/stashr/templates/single_volume_page.html index fe1f703..6c7a680 100644 --- a/stashr/templates/single_volume_page.html +++ b/stashr/templates/single_volume_page.html @@ -418,6 +418,86 @@ Vue.component('modals-volume', { Vue.component('volume-jumbo', { props: ['volume'], template: ` +
+
+
+
+
+
+ + [[ volume.volume_name ]] + + +
+ + + [[ statusWord ]] + + [[ volume.age_rating[0].rating_long ]] + + + [[ volume.volume_year ]] + +
+ + + [[ publisherName ]] + + + + ComicVine + +
+ Digital: [[ volume.volume_have ]]/[[ volume.volume_total ]] + Physical: [[ ownedNumber ]]/[[ volume.volume_total ]] + Read: [[ readNumber ]]/[[ volume.volume_total ]] +
+ {{ emit_tep('single_volume_page_badge_row', volume_id=volume_id) }} +
+
+
+
+ + + +
+
+
+
+
[[ volume.volume_name ]]
+ +
+
+ {% if (current_user.role.lower() == 'admin') or + (current_user.role.lower() == 'librarian') %} + + + + + {% endif %} + {{ emit_tep("single_volume_page_action_dropdown", volume_id=volume_id) }} +
+
+
+ `, computed: { publisherName() { diff --git a/stashr/utils.py b/stashr/utils.py index 6536326..fe2a09e 100644 --- a/stashr/utils.py +++ b/stashr/utils.py @@ -1016,7 +1016,7 @@ def new_get_scrape_candidates(item): if str(candidate['start_year']) in item.directory_path: scrape_candidate = candidate['id'] match_found = False - + scrape_item.scrape_json = json.dumps(candidates.results) scrape_item.scrape_candidate = scrape_candidate scrape_item.scrape_match = match_found @@ -1025,6 +1025,11 @@ def new_get_scrape_candidates(item): database.session.merge(scrape_item) database.session.commit() + if not match_found: + print('extend the results') + # new_scrape_extend_matches_by_item(scrape_item) + new_scrape_extend_matches(scrape_item.scrape_id) + pass def new_add_scraped_matches(): matched_directories = database.session \ @@ -1063,16 +1068,37 @@ def new_add_scrape_match(item): scan_volume_files(item.scrape_candidate) -def new_scrape_extend_matches(scrape_id): +def new_scrape_extend_matches_by_item(item): + + candidates = cv.search(item.scrape_directory, limit=100, resources=['volume']) + + # print(candidates.results) + print(len(candidates.results)) + item.scrape_json = json.dumps(candidates.results) + + database.session.merge(item) + database.session.commit() + + +def new_scrape_extend_matches(scrape_id, search_terms=None): scrape_item = database.session \ .query(database.ScrapeItems) \ .filter(database.ScrapeItems.scrape_id == scrape_id) \ .first() - candidates = cv.search(scrape_item.scrape_directory, resources=['volume']) + if search_terms is None: + candidates = cv.search(scrape_item.scrape_directory, limit=100, resources=['volume']) + else: + candidates = cv.search(search_terms, limit=100, resources=['volume']) + + print(len(candidates.results)) + + scrape_item.scrape_json = json.dumps(candidates.results) + + database.session.merge(scrape_item) + database.session.commit() - pass """ --------------------- (UN)INSTALL PLUGINS --------------------- """