summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-05-04 16:27:03 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-05-04 16:27:03 +0900
commitb5acf15877908a4b0e60324c1371aad623b5529d (patch)
tree0f1145a784e046bf6c1df40e0ff905deeafd23fb
parentドライブのファイルにユーザー情報を非正規化 (diff)
downloadmisskey-b5acf15877908a4b0e60324c1371aad623b5529d.tar.gz
misskey-b5acf15877908a4b0e60324c1371aad623b5529d.tar.bz2
misskey-b5acf15877908a4b0e60324c1371aad623b5529d.zip
2.0.0
Diffstat (limited to '')
-rw-r--r--migration/2.0.0.js57
-rw-r--r--migration/2018-04-19.js49
-rw-r--r--package.json4
-rw-r--r--src/client/app/common/views/components/media-list.vue17
-rw-r--r--src/client/app/common/views/components/othello.vue16
-rw-r--r--src/client/app/desktop/views/components/media-image.vue12
-rw-r--r--src/client/app/desktop/views/components/media-video.vue1
-rw-r--r--src/client/app/desktop/views/components/note-detail.vue2
-rw-r--r--src/client/app/desktop/views/components/note-preview.vue1
-rw-r--r--src/client/app/desktop/views/components/notes.note.sub.vue1
-rw-r--r--src/client/app/desktop/views/components/notes.note.vue2
-rw-r--r--src/client/app/mobile/views/components/media-image.vue12
-rw-r--r--src/client/app/mobile/views/components/note-detail.sub.vue1
-rw-r--r--src/client/app/mobile/views/components/note-detail.vue2
-rw-r--r--src/client/app/mobile/views/components/note-preview.vue1
-rw-r--r--src/client/app/mobile/views/components/note.sub.vue1
-rw-r--r--src/client/app/mobile/views/components/note.vue2
-rw-r--r--src/client/app/mobile/views/components/notification.vue2
18 files changed, 109 insertions, 74 deletions
diff --git a/migration/2.0.0.js b/migration/2.0.0.js
new file mode 100644
index 0000000000..eb8f5730c7
--- /dev/null
+++ b/migration/2.0.0.js
@@ -0,0 +1,57 @@
+// for Node.js interpret
+
+const chalk = require('chalk');
+const sequential = require('promise-sequential');
+
+const { default: User } = require('../built/models/user');
+const { default: DriveFile } = require('../built/models/drive-file');
+
+async function main() {
+ const promiseGens = [];
+
+ const count = await DriveFile.count({});
+
+ let prev;
+
+ for (let i = 0; i < count; i++) {
+ promiseGens.push(() => {
+ const promise = new Promise(async (res, rej) => {
+ const file = await DriveFile.findOne(prev ? {
+ _id: { $gt: prev._id }
+ } : {}, {
+ sort: {
+ _id: 1
+ }
+ });
+
+ prev = file;
+
+ const user = await User.findOne({ _id: file.metadata.userId });
+
+ DriveFile.update({
+ _id: file._id
+ }, {
+ $set: {
+ 'metadata._user': {
+ host: user.host
+ }
+ }
+ }).then(() => {
+ res([i, file]);
+ }).catch(rej);
+ });
+
+ promise.then(([i, file]) => {
+ console.log(chalk`{gray ${i}} {green done: {bold ${file._id}} ${file.filename}}`);
+ });
+
+ return promise;
+ });
+ }
+
+ return await sequential(promiseGens);
+}
+
+main().then(() => {
+ console.log('ALL DONE');
+}).catch(console.error);
diff --git a/migration/2018-04-19.js b/migration/2018-04-19.js
deleted file mode 100644
index b0df22c009..0000000000
--- a/migration/2018-04-19.js
+++ /dev/null
@@ -1,49 +0,0 @@
-// for Node.js interpret
-
-const { default: User } = require('../built/models/user');
-const { default: Following } = require('../built/models/following');
-const { default: zip } = require('@prezzemolo/zip')
-
-const migrate = async (following) => {
- const follower = await User.findOne({ _id: following.followerId });
- const followee = await User.findOne({ _id: following.followeeId });
- const result = await Following.update(following._id, {
- $set: {
- stalk: true,
- _follower: {
- host: follower.host,
- inbox: follower.host != null ? follower.inbox : undefined
- },
- _followee: {
- host: followee.host,
- inbox: followee.host != null ? followee.inbox : undefined
- }
- }
- });
- return result.ok === 1;
-}
-
-async function main() {
- const count = await Following.count({});
-
- const dop = Number.parseInt(process.argv[2]) || 5
- const idop = ((count - (count % dop)) / dop) + 1
-
- return zip(
- 1,
- async (time) => {
- console.log(`${time} / ${idop}`)
- const doc = await Following.find({}, {
- limit: dop, skip: time * dop
- })
- return Promise.all(doc.map(migrate))
- },
- idop
- ).then(a => {
- const rv = []
- a.forEach(e => rv.push(...e))
- return rv
- })
-}
-
-main().then(console.dir).catch(console.error)
diff --git a/package.json b/package.json
index 1d6cf4b9e8..c29b9d5d8d 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
{
"name": "misskey",
"author": "syuilo <i@syuilo.com>",
- "version": "1.7.0",
- "clientVersion": "1.0.5175",
+ "version": "2.0.0",
+ "clientVersion": "1.0.5184",
"codename": "nighthike",
"main": "./built/index.js",
"private": true,
diff --git a/src/client/app/common/views/components/media-list.vue b/src/client/app/common/views/components/media-list.vue
index 64172ad0b4..ff9d5e1022 100644
--- a/src/client/app/common/views/components/media-list.vue
+++ b/src/client/app/common/views/components/media-list.vue
@@ -2,7 +2,7 @@
<div class="mk-media-list" :data-count="mediaList.length">
<template v-for="media in mediaList">
<mk-media-video :video="media" :key="media.id" v-if="media.type.startsWith('video')" :inline-playable="mediaList.length === 1"/>
- <mk-media-image :image="media" :key="media.id" v-else />
+ <mk-media-image :image="media" :key="media.id" v-else :raw="raw"/>
</template>
</div>
</template>
@@ -11,7 +11,14 @@
import Vue from 'vue';
export default Vue.extend({
- props: ['mediaList'],
+ props: {
+ mediaList: {
+ required: true
+ },
+ raw: {
+ default: false
+ }
+ }
});
</script>
@@ -23,7 +30,7 @@ export default Vue.extend({
@media (max-width 500px)
height 192px
-
+
&[data-count="1"]
grid-template-rows 1fr
&[data-count="2"]
@@ -40,7 +47,7 @@ export default Vue.extend({
&[data-count="4"]
grid-template-columns 1fr 1fr
grid-template-rows 1fr 1fr
-
+
:nth-child(1)
grid-column 1 / 2
grid-row 1 / 2
@@ -53,5 +60,5 @@ export default Vue.extend({
:nth-child(4)
grid-column 2 / 3
grid-row 2 / 3
-
+
</style>
diff --git a/src/client/app/common/views/components/othello.vue b/src/client/app/common/views/components/othello.vue
index 8f7d9dfd6a..fafa047255 100644
--- a/src/client/app/common/views/components/othello.vue
+++ b/src/client/app/common/views/components/othello.vue
@@ -31,7 +31,7 @@
<section v-if="invitations.length > 0">
<h2>対局の招待があります!:</h2>
<div class="invitation" v-for="i in invitations" tabindex="-1" @click="accept(i)">
- <img :src="`${i.parent.avatarUrl}?thumbnail&size=32`" alt="">
+ <mk-avatar class="avatar" :user="i.parent"/>
<span class="name"><b>{{ i.parent.name }}</b></span>
<span class="username">@{{ i.parent.username }}</span>
<mk-time :time="i.createdAt"/>
@@ -40,8 +40,8 @@
<section v-if="myGames.length > 0">
<h2>自分の対局</h2>
<a class="game" v-for="g in myGames" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`">
- <img :src="`${g.user1.avatarUrl}?thumbnail&size=32`" alt="">
- <img :src="`${g.user2.avatarUrl}?thumbnail&size=32`" alt="">
+ <mk-avatar class="avatar" :user="g.user1.avatarUrl"/>
+ <mk-avatar class="avatar" :user="g.user2.avatarUrl"/>
<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
</a>
@@ -49,8 +49,8 @@
<section v-if="games.length > 0">
<h2>みんなの対局</h2>
<a class="game" v-for="g in games" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`">
- <img :src="`${g.user1.avatarUrl}?thumbnail&size=32`" alt="">
- <img :src="`${g.user2.avatarUrl}?thumbnail&size=32`" alt="">
+ <mk-avatar class="avatar" :user="g.user1.avatarUrl"/>
+ <mk-avatar class="avatar" :user="g.user2.avatarUrl"/>
<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
</a>
@@ -271,8 +271,7 @@ export default Vue.extend({
&:active
background #eee
- > img
- vertical-align bottom
+ > .avatar
border-radius 100%
> span
@@ -301,8 +300,7 @@ export default Vue.extend({
&:active
background #eee
- > img
- vertical-align bottom
+ > .avatar
border-radius 100%
> span
diff --git a/src/client/app/desktop/views/components/media-image.vue b/src/client/app/desktop/views/components/media-image.vue
index 3d28d5149d..e5803cc36e 100644
--- a/src/client/app/desktop/views/components/media-image.vue
+++ b/src/client/app/desktop/views/components/media-image.vue
@@ -14,12 +14,20 @@ import Vue from 'vue';
import MkMediaImageDialog from './media-image-dialog.vue';
export default Vue.extend({
- props: ['image'],
+ props: {
+ image: {
+ type: Object,
+ required: true
+ },
+ raw: {
+ default: false
+ }
+ },
computed: {
style(): any {
return {
'background-color': this.image.properties.avgColor ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
- 'background-image': `url(${this.image.url}?thumbnail&size=512)`
+ 'background-image': this.raw ? `url(${this.image.url})` : `url(${this.image.url}?thumbnail&size=512)`
};
}
},
diff --git a/src/client/app/desktop/views/components/media-video.vue b/src/client/app/desktop/views/components/media-video.vue
index 4fd955a821..3635941e64 100644
--- a/src/client/app/desktop/views/components/media-video.vue
+++ b/src/client/app/desktop/views/components/media-video.vue
@@ -52,6 +52,7 @@ export default Vue.extend({
width 100%
height 100%
border-radius 4px
+
.mk-media-video-thumbnail
display flex
justify-content center
diff --git a/src/client/app/desktop/views/components/note-detail.vue b/src/client/app/desktop/views/components/note-detail.vue
index 5d07dc90d4..a0e3915149 100644
--- a/src/client/app/desktop/views/components/note-detail.vue
+++ b/src/client/app/desktop/views/components/note-detail.vue
@@ -39,7 +39,7 @@
<mk-note-html v-if="p.text" :text="p.text" :i="os.i"/>
</div>
<div class="media" v-if="p.media.length > 0">
- <mk-media-list :media-list="p.media"/>
+ <mk-media-list :media-list="p.media" :raw="true"/>
</div>
<mk-poll v-if="p.poll" :note="p"/>
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
diff --git a/src/client/app/desktop/views/components/note-preview.vue b/src/client/app/desktop/views/components/note-preview.vue
index 43eb159885..d04abfc5a7 100644
--- a/src/client/app/desktop/views/components/note-preview.vue
+++ b/src/client/app/desktop/views/components/note-preview.vue
@@ -53,6 +53,7 @@ root(isDark)
> header
display flex
+ align-items baseline
white-space nowrap
> .name
diff --git a/src/client/app/desktop/views/components/notes.note.sub.vue b/src/client/app/desktop/views/components/notes.note.sub.vue
index 238fb03691..575d605203 100644
--- a/src/client/app/desktop/views/components/notes.note.sub.vue
+++ b/src/client/app/desktop/views/components/notes.note.sub.vue
@@ -65,6 +65,7 @@ root(isDark)
> header
display flex
+ align-items baseline
margin-bottom 2px
white-space nowrap
line-height 21px
diff --git a/src/client/app/desktop/views/components/notes.note.vue b/src/client/app/desktop/views/components/notes.note.vue
index b512f78eca..9adbfc0172 100644
--- a/src/client/app/desktop/views/components/notes.note.vue
+++ b/src/client/app/desktop/views/components/notes.note.vue
@@ -400,7 +400,7 @@ root(isDark)
> header
display flex
- align-items center
+ align-items baseline
margin-bottom 4px
white-space nowrap
diff --git a/src/client/app/mobile/views/components/media-image.vue b/src/client/app/mobile/views/components/media-image.vue
index cfc2134988..92d1cdc6f5 100644
--- a/src/client/app/mobile/views/components/media-image.vue
+++ b/src/client/app/mobile/views/components/media-image.vue
@@ -6,12 +6,20 @@
import Vue from 'vue';
export default Vue.extend({
- props: ['image'],
+ props: {
+ image: {
+ type: Object,
+ required: true
+ },
+ raw: {
+ default: false
+ }
+ },
computed: {
style(): any {
return {
'background-color': this.image.properties.avgColor ? `rgb(${this.image.properties.avgColor.join(',')})` : 'transparent',
- 'background-image': `url(${this.image.url}?thumbnail&size=512)`
+ 'background-image': this.raw ? `url(${this.image.url})` : `url(${this.image.url}?thumbnail&size=512)`
};
}
}
diff --git a/src/client/app/mobile/views/components/note-detail.sub.vue b/src/client/app/mobile/views/components/note-detail.sub.vue
index 34ff06db30..e515fda8a6 100644
--- a/src/client/app/mobile/views/components/note-detail.sub.vue
+++ b/src/client/app/mobile/views/components/note-detail.sub.vue
@@ -55,6 +55,7 @@ root(isDark)
> header
display flex
+ align-items baseline
margin-bottom 4px
white-space nowrap
diff --git a/src/client/app/mobile/views/components/note-detail.vue b/src/client/app/mobile/views/components/note-detail.vue
index b9bd9fe495..5a7226faac 100644
--- a/src/client/app/mobile/views/components/note-detail.vue
+++ b/src/client/app/mobile/views/components/note-detail.vue
@@ -37,7 +37,7 @@
<router-link v-for="tag in p.tags" :key="tag" :to="`/search?q=#${tag}`">{{ tag }}</router-link>
</div>
<div class="media" v-if="p.media.length > 0">
- <mk-media-list :media-list="p.media"/>
+ <mk-media-list :media-list="p.media" :raw="true"/>
</div>
<mk-poll v-if="p.poll" :note="p"/>
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
diff --git a/src/client/app/mobile/views/components/note-preview.vue b/src/client/app/mobile/views/components/note-preview.vue
index e9fe9b1bdd..ec11f23315 100644
--- a/src/client/app/mobile/views/components/note-preview.vue
+++ b/src/client/app/mobile/views/components/note-preview.vue
@@ -49,6 +49,7 @@ root(isDark)
> header
display flex
+ align-items baseline
margin-bottom 4px
white-space nowrap
diff --git a/src/client/app/mobile/views/components/note.sub.vue b/src/client/app/mobile/views/components/note.sub.vue
index 251b377fb2..82025291da 100644
--- a/src/client/app/mobile/views/components/note.sub.vue
+++ b/src/client/app/mobile/views/components/note.sub.vue
@@ -69,6 +69,7 @@ root(isDark)
> header
display flex
+ align-items baseline
margin-bottom 2px
white-space nowrap
diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue
index f3aab49bb0..401ffa278c 100644
--- a/src/client/app/mobile/views/components/note.vue
+++ b/src/client/app/mobile/views/components/note.vue
@@ -333,7 +333,7 @@ root(isDark)
> header
display flex
- align-items center
+ align-items baseline
white-space nowrap
@media (min-width 500px)
diff --git a/src/client/app/mobile/views/components/notification.vue b/src/client/app/mobile/views/components/notification.vue
index 13ca95075c..c1b37563ce 100644
--- a/src/client/app/mobile/views/components/notification.vue
+++ b/src/client/app/mobile/views/components/notification.vue
@@ -124,7 +124,7 @@ root(isDark)
> header
display flex
- align-items center
+ align-items baseline
white-space nowrap
i, .mk-reaction-icon