Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix single class items failing to save
  • Loading branch information
Smashman committed Mar 15, 2021
1 parent b1fd61d commit 3ea1192
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions app/utils/utils.py
Expand Up @@ -171,32 +171,32 @@ def extract_and_image(zip_in, db_record):
class_and_model = {tf2_class: class_model}
class_models.update(class_and_model)

# Update database record

db_record.name = safe_name
db_record.pretty_name = manifest['ImportSession']['name']
db_record.manifest_steamid = int(manifest['steamid'], 16)
db_record.item_slot = "misc" # Only miscs have Workshop zips to date
db_record.image_inventory = items_game_info.get('image_inventory')
if bodygroups:
for bodygroup in bodygroups:
bg_db = TF2BodyGroup.query.get(bodygroup)
if bg_db:
db_record.bodygroups.append(bg_db)
if equip_regions:
for er in equip_regions:
er_db = TF2EquipRegion.query.get(er)
if er_db:
db_record.equip_regions.append(er_db)
if class_models:
for class_name, model in class_models.items():
db_record.class_model[class_name] = (get_or_create(db.session, ModClassModel, mod_id=mod_id,
class_name=class_name, model_path=model))

# And we're fin
print "Done: {}".format(db_record.zip_file)
db_record.completed = True
return db_record
# Update database record

db_record.name = safe_name
db_record.pretty_name = manifest['ImportSession']['name']
db_record.manifest_steamid = int(manifest['steamid'], 16)
db_record.item_slot = "misc" # Only miscs have Workshop zips to date
db_record.image_inventory = items_game_info.get('image_inventory')
if bodygroups:
for bodygroup in bodygroups:
bg_db = TF2BodyGroup.query.get(bodygroup)
if bg_db:
db_record.bodygroups.append(bg_db)
if equip_regions:
for er in equip_regions:
er_db = TF2EquipRegion.query.get(er)
if er_db:
db_record.equip_regions.append(er_db)
if class_models:
for class_name, model in class_models.items():
db_record.class_model[class_name] = (get_or_create(db.session, ModClassModel, mod_id=mod_id,
class_name=class_name, model_path=model))

# And we're fin
print "Done: {}".format(db_record.zip_file)
db_record.completed = True
return db_record


def vpk_package(folder):
Expand Down

2 comments on commit 3ea1192

@Rolling-Suricate
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better search bar
Some additions you could inculde to improve the search bar:
List by x: lists items from least to most downloaded or by number of authors
Item type name/search by "replacement for x": ability to quickly see items for a specific category, like searching hat as item type will only display hats, searching an item already in the game will show replacements for that item, e.g. team player will show results for scout shirts
Add a weapon category: be it war paints or weapon reskins, this site is really missing those

@Smashman
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a new issue, rather than comment on an existing commit here: https://github.com/Smashman/mods.tf/issues

Thanks

Please sign in to comment.