aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql
diff options
context:
space:
mode:
authorJoar Wandborg <git@wandborg.com>2012-07-11 00:36:42 +0200
committerJoar Wandborg <git@wandborg.com>2012-07-11 00:36:42 +0200
commit6471291575c97f03d129051dc3d2bef28b4d89f2 (patch)
tree0c1252c0c23c2978736dd6eb819aefa89c1e355a /mediagoblin/db/sql
parent51eb0267d901bafcc90879dadbc2b8616ecdc4f5 (diff)
downloadmediagoblin-6471291575c97f03d129051dc3d2bef28b4d89f2.tar.lz
mediagoblin-6471291575c97f03d129051dc3d2bef28b4d89f2.tar.xz
mediagoblin-6471291575c97f03d129051dc3d2bef28b4d89f2.zip
Panel improvements
- Added progress meter for video and audio media types. - Changed the __repr__ method of a MediaEntry to display a bit more useful explanation. - Added a new MediaEntry.state, 'processing', which means that the task is running the processor on the item currently. - Fixed some PEP8 issues in user_pages/views.py - Fixed the ATOM TAG URI to show the correct year.
Diffstat (limited to 'mediagoblin/db/sql')
-rw-r--r--mediagoblin/db/sql/migrations.py14
-rw-r--r--mediagoblin/db/sql/models.py8
2 files changed, 21 insertions, 1 deletions
diff --git a/mediagoblin/db/sql/migrations.py b/mediagoblin/db/sql/migrations.py
index d6b709b2..49798a54 100644
--- a/mediagoblin/db/sql/migrations.py
+++ b/mediagoblin/db/sql/migrations.py
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from sqlalchemy import MetaData, Table, Column, Boolean
+from sqlalchemy import MetaData, Table, Column, Boolean, SmallInteger
from mediagoblin.db.sql.util import RegisterMigration
@@ -47,3 +47,15 @@ def add_wants_notification_column(db_conn):
default=True, nullable=True)
col.create(users, populate_defaults=True)
db_conn.commit()
+
+
+@RegisterMigration(3, MIGRATIONS)
+def add_transcoding_progress(db_conn):
+ metadata = MetaData(bind=db_conn.bind)
+
+ media_entry = Table('core__media_entries', metadata, autoload=True,
+ autoload_with=db_conn.bind)
+
+ col = Column('transcoding_progress', SmallInteger)
+ col.create(media_entry)
+ db_conn.commit()
diff --git a/mediagoblin/db/sql/models.py b/mediagoblin/db/sql/models.py
index 9815fcf9..6ce4e06f 100644
--- a/mediagoblin/db/sql/models.py
+++ b/mediagoblin/db/sql/models.py
@@ -107,6 +107,8 @@ class MediaEntry(Base, MediaEntryMixin):
fail_error = Column(Unicode)
fail_metadata = Column(JSONEncoded)
+ transcoding_progress = Column(SmallInteger)
+
queued_media_file = Column(PathTupleWithSlashes)
queued_task_id = Column(Unicode)
@@ -209,6 +211,12 @@ class MediaEntry(Base, MediaEntryMixin):
__import__(models_module)
return sys.modules[models_module].DATA_MODEL
+ def __repr__(self):
+ return '<{classname} {id}: {title}>'.format(
+ classname=self.__class__.__name__,
+ id=self.id,
+ title=self.title)
+
class FileKeynames(Base):
"""