Loading opds_catalog/migrations/0003_auto_20161116_0955.py 0 → 100644 +76 −0 Original line number Diff line number Diff line # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-16 06:55 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('opds_catalog', '0002_auto_20161115_1810'), ] operations = [ migrations.AlterField( model_name='book', name='docdate', field=models.CharField(db_index=True, max_length=32), ), migrations.AlterField( model_name='book', name='filename', field=models.CharField(max_length=512), ), migrations.AlterField( model_name='book', name='filesize', field=models.IntegerField(default=0), ), migrations.AlterField( model_name='book', name='format', field=models.CharField(max_length=8), ), migrations.AlterField( model_name='book', name='path', field=models.CharField(max_length=512), ), migrations.AlterField( model_name='book', name='registerdate', field=models.DateTimeField(default=django.utils.timezone.now), ), migrations.AlterField( model_name='book', name='search_title', field=models.CharField(db_index=True, default=None, max_length=512), ), migrations.AlterField( model_name='book', name='title', field=models.CharField(db_index=True, max_length=512), ), migrations.AlterField( model_name='bookshelf', name='readtime', field=models.DateTimeField(db_index=True, default=django.utils.timezone.now), ), migrations.AlterField( model_name='catalog', name='cat_name', field=models.CharField(db_index=True, max_length=190), ), migrations.AlterField( model_name='catalog', name='path', field=models.CharField(db_index=True, max_length=512), ), migrations.AlterField( model_name='series', name='search_ser', field=models.CharField(db_index=True, default=None, max_length=150), ), ] opds_catalog/opdsdb.py +6 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ def clear_all(): # три позиции (0,1,2) сделаны для того чтобы сделать возможным корректную работу # cgi-скрипта во время сканирования библиотеки # def p(s,size): new = s.decode('utf8').encode('utf8', 'replace')[:size] return new def getlangcode(s): langcode = 9 if len(s)==0: Loading Loading @@ -169,7 +174,7 @@ def findbook(name, path, setavail=0): def addbook(name, path, cat, exten, title, annotation, docdate, lang, size=0, archive=0): book = Book.objects.create(filename=name[:SIZE_BOOK_FILENAME],path=path[:SIZE_BOOK_PATH],catalog=cat,filesize=size,format=exten.lower()[:SIZE_BOOK_FORMAT], title=title[:SIZE_BOOK_TITLE],search_title=title.upper()[:SIZE_BOOK_TITLE],annotation=annotation[:SIZE_BOOK_ANNOTATION], title=title[:SIZE_BOOK_TITLE],search_title=title.upper()[:SIZE_BOOK_TITLE],annotation=p(annotation,SIZE_BOOK_ANNOTATION), docdate=docdate[:SIZE_BOOK_DOCDATE],lang=lang[:SIZE_BOOK_LANG],cat_type=archive,avail=2, lang_code=getlangcode(title)) return book Loading sopds/settings.py +2 −1 Original line number Diff line number Diff line Loading @@ -92,8 +92,9 @@ WSGI_APPLICATION = 'sopds.wsgi.application' # 'USER': 'sopds', # 'PASSWORD' : 'sopds', # 'OPTIONS' : { # 'init_command': 'SET default_storage_engine=INNODB', # 'init_command': "SET default_storage_engine=INNODB", # 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'" # 'init_command': "SET NAMES UTF8" # } # } #} Loading Loading
opds_catalog/migrations/0003_auto_20161116_0955.py 0 → 100644 +76 −0 Original line number Diff line number Diff line # -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-16 06:55 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('opds_catalog', '0002_auto_20161115_1810'), ] operations = [ migrations.AlterField( model_name='book', name='docdate', field=models.CharField(db_index=True, max_length=32), ), migrations.AlterField( model_name='book', name='filename', field=models.CharField(max_length=512), ), migrations.AlterField( model_name='book', name='filesize', field=models.IntegerField(default=0), ), migrations.AlterField( model_name='book', name='format', field=models.CharField(max_length=8), ), migrations.AlterField( model_name='book', name='path', field=models.CharField(max_length=512), ), migrations.AlterField( model_name='book', name='registerdate', field=models.DateTimeField(default=django.utils.timezone.now), ), migrations.AlterField( model_name='book', name='search_title', field=models.CharField(db_index=True, default=None, max_length=512), ), migrations.AlterField( model_name='book', name='title', field=models.CharField(db_index=True, max_length=512), ), migrations.AlterField( model_name='bookshelf', name='readtime', field=models.DateTimeField(db_index=True, default=django.utils.timezone.now), ), migrations.AlterField( model_name='catalog', name='cat_name', field=models.CharField(db_index=True, max_length=190), ), migrations.AlterField( model_name='catalog', name='path', field=models.CharField(db_index=True, max_length=512), ), migrations.AlterField( model_name='series', name='search_ser', field=models.CharField(db_index=True, default=None, max_length=150), ), ]
opds_catalog/opdsdb.py +6 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ def clear_all(): # три позиции (0,1,2) сделаны для того чтобы сделать возможным корректную работу # cgi-скрипта во время сканирования библиотеки # def p(s,size): new = s.decode('utf8').encode('utf8', 'replace')[:size] return new def getlangcode(s): langcode = 9 if len(s)==0: Loading Loading @@ -169,7 +174,7 @@ def findbook(name, path, setavail=0): def addbook(name, path, cat, exten, title, annotation, docdate, lang, size=0, archive=0): book = Book.objects.create(filename=name[:SIZE_BOOK_FILENAME],path=path[:SIZE_BOOK_PATH],catalog=cat,filesize=size,format=exten.lower()[:SIZE_BOOK_FORMAT], title=title[:SIZE_BOOK_TITLE],search_title=title.upper()[:SIZE_BOOK_TITLE],annotation=annotation[:SIZE_BOOK_ANNOTATION], title=title[:SIZE_BOOK_TITLE],search_title=title.upper()[:SIZE_BOOK_TITLE],annotation=p(annotation,SIZE_BOOK_ANNOTATION), docdate=docdate[:SIZE_BOOK_DOCDATE],lang=lang[:SIZE_BOOK_LANG],cat_type=archive,avail=2, lang_code=getlangcode(title)) return book Loading
sopds/settings.py +2 −1 Original line number Diff line number Diff line Loading @@ -92,8 +92,9 @@ WSGI_APPLICATION = 'sopds.wsgi.application' # 'USER': 'sopds', # 'PASSWORD' : 'sopds', # 'OPTIONS' : { # 'init_command': 'SET default_storage_engine=INNODB', # 'init_command': "SET default_storage_engine=INNODB", # 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'" # 'init_command': "SET NAMES UTF8" # } # } #} Loading